|
|
|
|
|
by chhickman
1863 days ago
|
|
This is perhaps going to be an unpopular sentiment, but I think far too much breath is wasted on the "don't be clever" edict. No examples even spring to mind of any past experience where I ran into someone's "too clever" code causing me headaches. It has been dealing with the mountains of "not the least bit clever" code that has sucked thousands of hours out of my career. Mundane, "straightforward" code where they've re-used variables for different purposes, or deeply nested conditionals with multiple, multiple booleans in each check (often redundant, if not contradictory) and generally taken 50 lines of code to accomplish what could be done more cleanly in 10 or fewer. I'll take puzzling a few minutes over some too clever code over slogging through spaghetti code any day. |
|
I think the "don't be clever" edict applies to code segments that are best described as "you won't believe what happens next!", and fairly so.