3 ms·
I'm not sure what exactly you found insulting.
by catnaroek 10y ago
I'm not sure what exactly you found insulting.
- igravious 10y agoHi. I've been coding for over 20 years. Do you think it likely that "arguably you don't understand recursion"? (I suppose it's possible, there are some pretty awful programmers out there who should never have become programmers but did because their parents made them because that's where the jobs and money are -- I've always seen /proper/† programmers like the craftsmen of old with guilds and folk-lore and accumulated wisdom and who treat the craft like a vocation.) Perhaps where we were at cross-purposes is that when I said recursion I meant recursive procedure but you were thinking of recursive data structures (and possibly also of recursive procedures). Why I contradicted you was that I didn't think your parent/ancestor example was a good explanation for recursive procedures but, yes, I now see that it is a good explanation of a recursive data structure. In fact, as you well know, in a tree data structure we call the node upstream from the current node the parent, and the node(s) downstream the child(ren). Your dismissal of my knowledge felt like an insult. I probably shouldn't be so thin-skinned. † I know, I know, who am I that I get to decide who is proper or not. But I once gave grinds to this guy who was forced to do computing by his folks and he had no interest and I couldn't get him interested and he didn't seem to be able to wrap his head around simple programming constructs. Maybe more a reflection on my ability to convey knowledge than his ability, sure.
- catnaroek 10y ago> Hi. I've been coding for over 20 years. Do you think it likely that "arguably you don't understand recursion"? If you thought the only recursive thing in existence is recursive procedures, yes, arguably you didn't understand recursion. (Which is fine, by the way - you can be a very successful programmer without understanding recursion.) > Perhaps where we were at cross-purposes is that when I said recursion I meant recursive procedure but you were thinking of recursive data structures (and possibly also of recursive procedures). When anyone says recursion, I understand recursion. Limiting your idea of “recursion” to recursive procedures is like limiting your idea of “black” to black T-shirts. > Why I contradicted you was that I didn't think your parent/ancestor example was a good explanation for recursive procedures but, yes, I now see that it is a good explanation of a recursive data structure. My parent/ancestor example was an example of a recursively defined relation, not a data structure. (I deliberately picked an example that most programmers wouldn't relate to code.) In Prolog it could be written: ancestor(X,Y) :- parent(X,Y). ancestor(X,Z) :- parent(X,Y), ancestor(Y,Z). Where `parent(X,Y)` means “Y is a parent of X”, and `ancestor(X,Y)` means “Y is an ancestor of X”.