4 ms·
Where are you working that you don't have tree structures, nor can't recite the generic three lines of pseudocode to traverse it? I have used trees in almost e
by Jasper_ 9y ago
Where are you working that you don't have tree structures, nor can't recite the generic three lines of pseudocode to traverse it?
I have used trees in almost every moderately complicated program I've ever written, both for fun and at the office.
- sidlls 9y agoSounds a bit like deriving the equations of kinematics over and over again to me. To each his or her own, but that just sounds incredibly boring to me.
- rnprince 9y agoI mean, I keep writing for-loops even though I've written many of them before.
- kaoD 9y agoFound the imperative programmer. I'm only half-joking: how often do you need an actual for loop instead of the more abstract concepts of mapping/reducing collections? I think you made his analogy stronger, not weaker. As a programmer I am (should be?) concerned with the actual implications of which data structures I use, not how to use them. It should be seamless. You wouldn't judge an EE on his ability to build wires after you give them some copper and plastic. Sure, he could with tools and a bit of time. It's just a waste of everyone's time and effort.
- rnprince 9y agoSome languages don't have first-class functions that you would pass into a map or reduce function, which makes writing loops unavoidable. But even if you do use map/reduce all the time instead of loops, you're just saying the same thing I did in another way - unless you're doing it for the intellectual thrill of writing a call to map/reduce for the n+1th time.
- Jasper_ 9y agoI mean, it's literally a for loop: def visit(node): for child in node.children: visit(child) I don't hire people in my current position, but I certainly think anyone baffled by that would be a giant red flag. It's simpler than FizzBuzz.