Hacker News new | ask | show | jobs
by Zpalmtree 3661 days ago
I find writing recursive code is often very short and easier to read and show intent than the same code written non recursively.
1 comments

Additionally, in languages with good, convenient support for functional programming like Haskell and Scala, I find that I tend to write lots of short functions, often making use of higher-order functions to decompose code into really simple, and potentially reusable, pieces. And like you say, this really helps to show intent. The same sort of thing, in fact, that object-oriented programmers try to do with design patterns such as the Strategy pattern - but with fewer lines of code.