3 ms·
I was talking to a friend who works in development and he says that they even frown on recursion now. They think it's too complex and causes junior programmers
by wkat4242 2y ago
I was talking to a friend who works in development and he says that they even frown on recursion now. They think it's too complex and causes junior programmers to footgun.
It's a shame because recursive code is often the most clean, elegant and fast for things like traversing trees.
- hinkley 2y agoOne of my peeves with JavaScript is that I feel the reduce() function has its arguments in the wrong order and increases cognitive load. Elixir’s is “right”. I’ve never been that much of a fan of recursion myself. Iteration and list comprehension for me.
- fifilura 2y agoI don't really write code that traverse trees that often these days. I do use libraries or services (e.g. SQL databases) that do though. And I have no idea whether the implementation of map/reduce I use is implemented as a recursive function or not, I just use it. If your friend works with implementing libraries or database engines I would be a bit shocked. If he implements applications and services I could agree that keeping things simple and not inventing your own frameworks could be a good idea.