/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

...

I miss the days of the steganography OP images

Why function declarations are so long here?
Why?

Fourth for FORTH

...

Is unit testing a meme?

big meaty coqs

How would you compute fib(1000) in a functional programming language using pure functions?
I'm sure it can be done but I don't see how to do fib relatively effectively without mutating explicit state.

recursion

fib = 0 : 1 : (zipWith (+) tail) fib

fib !! 1000

Unit testing is for pajeet and his friends. It's important when the turnover rate is so high fruit flies outlive your employment. Because when one Indian leaves the team you can't have the next fuck up the code for a day or two. Doesn't get you anywhere.

Unit tests are also OK for bad programmers to reassure themselves they're doing something good. So you see a lot of praise for it.

Well that's what wouldn't work is what I'm saying.
I'll have to look into that. Thanks.

>Well that's what wouldn't work is what I'm saying
Maybe tail recursion?
Like, fib n-2 n-1 n

see see tail call elimination

Is vi the only editor that is necessary to learn?

You don't need to learn Vi.
So no.

Learning bash and working through wargames. Is printf best for rounding up floating point values?

fib = 0 : 1 : (zipWith (+) tail) fib (haskell)

Can compute 100 000 in about a second

Convince me to read & complete SICP.

no

I get to be smug about having read it when ur done.

No, learn Emacs as well.

no, your kind doesn't deserve to.

Can someone tell me what the practical applications of non-WebDev programming is as far as like what jobs are available, who is hiring programmers and for what, generally. I am not being facetious btw, generally wanna get a better understanding. I honestly pretty much only see hobbyists or people learning programing (fizz buzz etc.) in these threads, with the occasional professional sysadmin or the like that just happens to know C or something. Whereas in the WebDev threads it's mostly professionals discussing new resources to better perform whatever task they might be assigned to. Again not trying to start shit I'm just trying to figure what career path I want to go down and the information would be valuable.

If you just want the number and not the list:

import Numeric.Natural

fib :: Natural -> Natural
fib n
| n == 0 = 0
| n == 1 = 1
| n == 2 = 1
| n >= 2 = fib(n-2) + fib(n-1)


(I have like a 10 minute understanding of Haskell, so no bully about idioms)

@58603947
ask on /r/programming

you can't go into programming wanting a job from absolutely nothing

Not an answer.

Also not an answer.