News for hackers. Stuff that matters.
Re:Why functional programming matters by hota_mazi on Tuesday April 18, 2017 @10:14AM (#14138959)
> Why compose classes, abstract base classes, etc. when you can compose simple functions!

Why only do one while you can do both?

Modern languages have first class functions and support class polymorphism and parametricity, which is still a very powerful way to describe problems intuitively.

Re:Why functional programming matters by humanrebar on Tuesday April 18, 2017 @10:57AM (#14139316)
> Why only do one while you can do both?

Theoretically you can do both. Practically, few languages give you the tools you'd want to ensure functional purity.

C++ is a multi-paradigm language, for instance. But it doesn't have any concept of immutable data. The 'const' keyword exists but it only does a very shallow check for immutability (i.e., the pointer won't change but its data might). And even with a 'const', there are still huge backdoors (the 'mutable' keyword).

Point being, it's possible, but you'd be relying on convention in your design and care in your implementation to make it work.

Re:Why functional programming matters by mpfundstein on Tuesday April 18, 2017 @04:04PM (#14142372)
I think C++'s const is one of the strongest consts I know of. Java/C#'s const on the other hand...
Re:Why functional programming matters by hota_mazi on Tuesday April 18, 2017 @07:55PM (#14144213)
It's actually too strong and the designers of the language later had to introduce `const_cast` in order to relax it in certain circumstances.

In practice, Java's weaker `final` (immutable references) appears to be a reasonable middle ground.