Re:Green Lumber Fallacy in Software Engineering
by lordnacho on Friday January 14, 2022 @01:41AM
(#29931293)
This is exactly right. Judgement is what coders really need. Does this thing look like an n^2 algorithm? Let's fix it. Does this thing look like something that someone else has likely come across before? Let's see what they did.
You cover a lot of ground as a coder having skimmed an algorithm book. So I do actually think there's some value in DSA preparation. At the same time I'll admit I don't have any of those things memorized, I just know they are things and can pattern match aka learn when they show up.
You realize the difference when you run into an inexperienced coder, especially a smart person like a quant. They run into a problem and think it's new, and solve it naively.
Because I've seen the algorithm more recently than "school" but perhaps not "last night while feverishly cramming so I can forget it in a week". Because I've probably solved the problem I'm looking at before, if not a neighbor close enough to get me in the ballpark, and I am never going to be without a search engine for the actual triviality that is the solution once that is identified. Because it is. It is triviality that has been turned into a measuring stick for one's technical coupling equipment by folks who have no better metric by which to evaluate. (And, to be fair, it's not the worst metric. It's also not a great one, though.)
The example that comes to mind first: I've written a topographical sort half a dozen times over the years. I recognize the problem set that it applies to on sight. And I do not have enough time in my ever-shrinking lifespan to bother to memorize how to write the thing optimally, though if I squint a little I'll probably get something that's okay if I sat down and spent half an hour with a REPL. (EDIT: went and looked up the last time I did it, and it's actually pretty good! Though bounded for `n` because I knew `n < 300` so I just used the call stack.)
So I'm not going to shed tears that I look it up when I run across a case where it's appropriate. Does that mean that on the movie set of a never-gonna-happen where I absolutely must create a satisfaction plan for a dependency tree that runs in absolutely minimal time, the bomb's gonna blow up and kill the President? Yeah, sure, but I live in the real world.
It doesn't happen a ton, because if we're being honest most jobs even at highly scaled companies are pretty Lego-y these days--but probably once or twice a year, yeah, I go "oh, that's an XYZ problem" and Google how to implement the optimal solution (or find that there's a package for it already).
Recognizing the shape of a problem is a skill. Calling to mind the exact algorithmic solution to that problem is a different skill. One of those two things is something that Google can do. (We are nearing a world where one of these two things, GPT-3 can do.)