MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x58u7b/howprogramminghaschanged/pgls56c/
r/ProgrammerHumor • u/shizzy0 • Oct 13 '26
108 comments sorted by
View all comments
Show parent comment
26
When I was studying, Fibonacci was used a lot to teach the value of dynamic programming. But agreed, it's a terrible example of when to use recursion.
21 u/fdar Oct 14 '26 DP is just recursion+caching. I think it makes sense to first recognize that the problem can be solved with recursion and then decide if DP is needed to improve performance. 5 u/Bliztle Oct 14 '26 Only if you're doing it top down. Bottom up is usually taught at the same time, and is useful to lessen stack and cache size.
21
DP is just recursion+caching.
I think it makes sense to first recognize that the problem can be solved with recursion and then decide if DP is needed to improve performance.
5 u/Bliztle Oct 14 '26 Only if you're doing it top down. Bottom up is usually taught at the same time, and is useful to lessen stack and cache size.
5
Only if you're doing it top down. Bottom up is usually taught at the same time, and is useful to lessen stack and cache size.
View all comments
Show parent comment
26
u/Silly_Guidance_8871 Oct 14 '26
When I was studying, Fibonacci was used a lot to teach the value of dynamic programming. But agreed, it's a terrible example of when to use recursion.