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/Zealousideal-Buy-382 Apr 05 '22

Recursion in functions

0

u/hehehuehue Apr 05 '22

You know how sometimes kids keep repeating the same thing until one is tired? It's just like that

Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: Yes
Kid 2: No
Kid 1: No <- base case where the argument would've only stopped if one said 'No' or the other said 'Yes', else this would've gone on forever.
Kid 2: No. Hah! Told you!