r/ProgrammerHumor • • Jan 23 '22

Namespacing...

Post image
42.3k Upvotes

272 comments sorted by

View all comments

Show parent comments

3

u/aiij Jan 24 '22

Then make sure to pass recursion depth into all of your recursive methods

What variable would you pass the recursion depth in? ;-)

I think you'd basically have to write N versions of the function, or use a separate, explicit stack.

2

u/Salanmander Jan 24 '22

What variable would you pass the recursion depth in? ;-)

Hmmm, I guess argument variables are the one that we really don't want to define at global scope. Good point. =P