r/learnprogramming • • Apr 05 '22

Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them

Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.

Someone else who reads yours and does understand it, try to explain it to them to help them learn

1.6k Upvotes

738 comments sorted by

View all comments

1

u/RenewAi Apr 05 '22

Recursion: A function that calls itself and stops calling itself when a certain condition is met, then somehow does a magic wrap up backwards thing that does all the calculations.

The last bit of recursion has stumped me for years. It just doesn't work with my brain for some reason.

1

u/ExtraFig6 Apr 06 '22

magic wrap up backwards thing that does all the calculations.

The last bit of recursion has stumped me for years. It just doesn't work with my brain

It does the same thing when you call a different function btw. Are you familiar with callstacks?