5 ms·
> The dumb (or lazy or new) developer will not notice or care about the appearance of a potential cool solution. They'll just bang out whatever works. The prag
by kstenerud 11y ago
> The dumb (or lazy or new) developer will not notice or care about the appearance of a potential cool solution. They'll just bang out whatever works.
The pragmatic programmer (aka the person I want to hire) would also not care about the appearance of a potential cool solution, because experience teaches us that clever solutions tend to increase complexity and cognitive load, increasing not only the bug count, but also maintenance costs.
Yes, by all means be clever where it's warranted (strange constraints, bottlenecks, etc), but please not in regular code!
- gharial 11y agoI really couldn't follow his logic at all. Being able to come up with a working (perfectly correct) solution somehow implies a developer is probably "dumb" or "lazy"? As if a truly "smart" or gifted programmer would be unable to come up with a solution because they're just oh so intelligent and clever. You either know how loops work or you don't.
- JoeAltmaier 11y agoMost smart programmers I know would prefer to product a good, or even the best, solution instead of any of the prosaic solutions. Unable to come up with a solution? Probably not. All the given examples are pedestrian. A really clever solution would recurse or search the web for a matching solution page or hash the solution space into a minimal table or something like that. But agreed a proper programmer would never fail to produce a correct solution.
- kstenerud 11y agoThat's sort of what I'm getting at. There are two kinds of smart programmers: Those who look for every opportunity to be clever, and those who are satisfied to build pedestrian solutions until clever code is called for. If you're going to build a clever solution (which almost by definition increases cognitive load on anyone reading or maintaining the code), you'd better be able to defend your actions. Performance is never a problem until it's demonstrated to be a problem.
- wtetzner 11y agoYeah, I'd say only go for a non-obvious solution if the result is at least as readable and maintainable as the obvious solution.
- JoeAltmaier 11y agoThis wasn't a case of work-for-hire. This was an interview situation, where its exactly your cleverness that is being examined. What do you do then? Pretend to be dumb?