News for hackers. Stuff that matters.
Re:Adventures of an imperative programmer in the land of fp by ww520 on Friday August 27, 2010 @01:21PM (#1639435)
It's great that more people are exposed to the functional programming style. Kudos to OP for trying something new.

It bugs me whenever FP people talk about state being bad as if it should be avoided at all cost. State is bad if its scope is not carefully managed. Global state is generally bad because its scope allows the whole program to modify it, making it difficult to follow its validity. Local state maintained as a local variable in a function is perfectly fine. Its scope is small and its changes can be tracked easily. Pure functional code actually also implicitly maintain state in their parameters and return values, and the passing of the return values as parameters to next function.

Re:Adventures of an imperative programmer in the land of fp by silentbicycle on Friday August 27, 2010 @01:50PM (#1639522)
It's ultimately about making code easier to reason about. Immutability (at least as a default) makes the dataflow between independent portions of your program clearer, since every value is determined by where it came from, not where it came from and everything that could have potentially touched it along the way.
Re:Adventures of an imperative programmer in the land of fp by silentbicycle on Friday August 27, 2010 @04:53PM (#1640245)
Oh: Easier for the compiler to reason about, too. Not just the programmers.