Hacker News new | ask | show | jobs
by koloron 3745 days ago
IMO, the difference in readability has little to do with the difference between OOP and FP. What's important is the expressiveness of the language.

So Ruby can be very easy to read because you can simply keep appending methods to the right.

In Haskell you can do the same, only you'll prepend functions on the left, so you end up reading expressions from right to left:

    (intercalate ", " . map show . Map.elems) myMap
What I find really hard to read, are expressions where the direction of the data flow changes, something that often happens to me in Java:

    Streams.takeWhile(list.stream().map(e -> f(e)), e -> e.isNeeded())
1 comments

Three completely unrelated things I guess.

1. Expressiveness is important? Expressiveness is why I don't like Perl.

2. You can certainly implement patterns analogous to OO in functional programming with closures and first-class functions.

3. Reading in the order of execution via chaining is definitely a lot more intuitive than reading from the inside out or right to left.