5 ms·
The more I program professionally, the less patience I have for clever code in a work setting. I used to love it, but after the nth time it caused me real, phy
by dmoy 6y ago
The more I program professionally, the less patience I have for clever code in a work setting. I used to love it, but after the nth time it caused me real, physical pain while oncall, I'm no longer a fan.
Clever code doesn't help me in a hundred million++ line repo of code maintained by thousands of people. It is actively detrimental.
Still fun to pick apart for leisure.
- saagarjha 6y agoOr to write about.
- bryanrasmussen 6y agocleverness is closely related to wit, and brevity is the soul of wit. A sufficient amount of cleverness often allows you to say in a few lines what would otherwise be said in 100s of lines - for example switch statements or numerous ifs going through each possibility with not much difference in how each branching is handled. I find the verbose listing of each possibility gives me physical pain, so I support cleverness in such situations.
- konjin 6y agoUntil the spec changes. The way I get around this is having a dsl no one but me sees that compiles to $lang of choice that everyone does. Once it produced 20k lines of code in an afternoon. I didn't have to do any work for the next month and still was the top performer by commits.
- chrisweekly 6y agoThat definition of "top performer" bears scrutiny. Code is nearly always a liability, not an asset. 20k LoC, generated by a secret tool, sounds more like grounds for firing than promotion. Or were you making a joke?
- konjin 6y agoHave you worked at big brain dead corp inc?
- chrisweekly 6y agoYep. But I never used being surrounded by nonsense as an excuse not to try to make things better.
- konjin 6y agoI was getting paid $1,800 per day for three months to do whatever they told me. Does it pay more to do things your way?
- deleted 6y ago[deleted]
- WhaleBasketball 6y agoIf I was motivated by money I’d be on an entirely different career path.
- konjin 6y agoThat's nice for you. What would that path be?
- shadowgovt 6y agoInvestment quant, usually. If a person wants to truly maximize dollar per hour.
- chrisweekly 6y agoYes. In more ways than one, too.
- ganafagol 6y ago100x this. "Clever" code that takes mere mortals 10x as much time to wrap their heads around than just doing the boring straight-down simple thing are one of the tell-tale signs of smart but inexperienced devs. Hopefully they get the right feedback and use their smartness to write well-structured understandable and maintainable code when they are more senior. Failing that thay tend to grow up into the bitter grumpy dude who just things everybody is stupid.
- layoutIfNeeded 6y ago+1 This is why Haskell & co will never be a mainstream language.
- valand 6y agoThis "clever code" is a bit misnomer for this kind of phenomena isn't it? Even overly-complex code is not an accurate term for that because overly-complex code can be caused by an overly-complex valid spec. "Stupidly out-of-spec code" or "Stupidly prematurely abstracted code" are more fitting to describe those kind of code. I personally feel uncomfortable calling them clever code because they are not clever at all so that they are causing physical pain. I'm fortunate to have a complete "creative-control" over a code several times. I frequently tell people to stop writing code that we don't need for the moment. Most of them are anticipation of reuses.