MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x58u7b/howprogramminghaschanged/pgt4566/?context=3
r/ProgrammerHumor • u/shizzy0 • 2d ago
101 comments sorted by
View all comments
311
Both have terrible stack usage.
145 u/temperamentalfish 1d ago Yeah I'm cringing at all the recursive solutions. Huge stack and so much repeated work. Just try counting how many times fib(5) would be executed to calculate fib(10). It's so often the go-to example for recursion and it's frankly terrible. 3 u/BitTwiddles 22h ago Write it in Erlang with tail recursion. In fact fib is the common demonstration case for recursion.
145
Yeah I'm cringing at all the recursive solutions. Huge stack and so much repeated work. Just try counting how many times fib(5) would be executed to calculate fib(10). It's so often the go-to example for recursion and it's frankly terrible.
3 u/BitTwiddles 22h ago Write it in Erlang with tail recursion. In fact fib is the common demonstration case for recursion.
3
Write it in Erlang with tail recursion. In fact fib is the common demonstration case for recursion.
311
u/torsten_dev 2d ago
Both have terrible stack usage.