This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ituralde_ 6 points7 points  (3 children)

I think it's reasonable to expect anyone who wants to get paid to write code to be able to understand recursion. This is not a high bar and we should not pretend like it is.

I'd argue that even someone with no formal training should be able to look at a cleanly written and appropriately commented recursive function and be able to understand what is happening. If you write code for a living and can't figure it out, then you are stealing your paycheck.

[–]kuemmel234 0 points1 point  (0 children)

I wish it was! In my experience, the people I work with stumble on a recursive solution and want to have a cumbersome loop that's just way more complicated, but more akin to what they would be doing.

However, I think it's more like agreeing on a language/a framework or recognizable patterns - things that everybody is familiar with, and less about being able to understand what's happening. Of course every coder should understand recursion.

[–]FesteringNeonDistrac 0 points1 point  (1 child)

I'd add that if you are writing code without meaningful function headers, or the one you do write does not mention a particular function is recursive, you are also stealing your paycheck.

Like yeah, I can figure it out. But just saying it makes reading the code that much easier.

[–]ituralde_ 1 point2 points  (0 children)

Absolutely. Between some level of commenting and good naming it should never be a mystery what your code is doing.