3 ms·
I like what I find clearest (a moving target for all sorts of reasons). I typically find recursion clearest for things dealing with terms/ASTs. My coding style
by philzook 2y ago
I like what I find clearest (a moving target for all sorts of reasons). I typically find recursion clearest for things dealing with terms/ASTs. My coding style usually leans towards comprehensions or fold/map etc rather than loops. That's why I find the loop being clearer for this algorithm surprising.
- tines 2y agoSame here, the answer is easy for me: recursive algorithms are for recursive data structures.
- CodeWriter23 2y agoCalling this out. A loop calling a function in terms of style is roughly the same as a function calling itself.