|
|
|
|
|
by skybrian
5955 days ago
|
|
Those are the standard claims, but drowning the reader in code that consists of lots of tiny, obscurely named functions (most of which you just defined), combined with abstractions based on high-level mathematics, limits your audience to people who would be comfortable reading mathematics papers. That's pretty much the opposite of making it easier to understand something. I like Haskell for the intellectual challenge, but if the aim is to write clear example code that will be understandable to a large audience, you'd be much better off writing it in Python. |
|
What I say is by using a functional style (might it be in java, c++, haskell, scheme, python, or whatever), it makes testing, threading and understanding things easier.
For instance, it's easier to test an immutable class since once it is created, it will never change.
Threading is also simplified since you don't have to think about your object being corrupted by 2 threads mutating it.
Understanding is simplified in the sense that it's easier to quickly get an idea of what an object is doing because it only has 1 state at a time.
But please, don't think I didn't understand your point about obscurely named function and bad code.. Often when people show functionnal code, they try to show how short the code is so they make it practically unreadable for the novices - which is indeed not the best way to show the vertue of FP.
"you'd be much better off writing it in Python." => Nothing stop you from using FP in python :)