Linked by Thom Holwerda on Thu 6th Sep 2012 18:07 UTC, submitted by MOS6510
General Development "Imagine an approach to programming where you write down some description of what your code should do, then before running your code you run some automatic tool to see if the code matches the description. That's Test-driven development, you say! Actually, this is what you are doing when you use static types in most languages too. Types are a description of the code's inputs and outputs, and the check ensures that inputs and outputs match up and are used consistently. Modern type systems - such as in Haskell or above - are very flexible, and allow these descriptions to be quite detailed; plus they are not too obtrusive in use and often very helpful."
Permalink for comment 534325
To read all comments associated with this story, please click here.
RE[2]: It's interesting...
by satsujinka on Sat 8th Sep 2012 02:57 UTC in reply to "RE: It's interesting..."
Member since:

Except Haskell really doesn't require too much of a change in thought patterns (especially if you've encountered other functional languages.) You don't have to use type annotations. You don't have to understand monads and arrows. You have to deal with immutability, but the concept isn't foreign (pretty much all languages have a notion of constants.) There's even 'do' notation that's basically an imperative language.

I think the thing that gets a lot of people is that functional languages are largely math based. For some reason that scares people, when it really should be viewed as a good thing. And in many ways it is, after all if you came out with a new language today and said it didn't have first class functions... you'd probably be laughed at.

Reply Parent Score: 2