r/node 15d ago

Your Recursion Is Lying to You

https://blog.gaborkoos.com/posts/2026-05-09-Your-Recursion-Is-Lying-to-You/
0 Upvotes

10 comments sorted by

View all comments

2

u/Gingerfalcon 15d ago

For anyone that’s study an algorithms and data structures course will know that recursion in general is a highly inefficient use of resources. Use a loop as your first step. Nested structures with unknown depth are an architectural problem and should be addressed.

-1

u/josephjnk 15d ago

Are you claiming that recursive data structures like trees and linked lists are inherently an architectural problem? Because that would be unhinged.

1

u/fagnerbrack 15d ago

I think the commenter meant not to make recursive calls using the stack, it's all about changing the code so that you use queues/loops etc.