Hacker News new | past | comments | ask | show | jobs | submit login

>Loops are easier to read. With functions like reduce you have to solve a puzzle every time to understand what the code is doing

I think that is a function of familiarity, if you use reduce a lot it will be as easy to read as a loop - perhaps easier because more compact - there is a downside to reading more lines for some people, at some point verbosity becomes its own source of illegibility (although any loop that can easily be turned into a reduce probably won't be excessively verbose anyway)

Of course all that is just on the personal level, you , by using and reading more code with reduce in it will stop finding reduce less easy to understand than loops - but the next programmer without lots of reduce experience will be in your same boat.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: