Hacker News new | ask | show | jobs
by foxylad 2584 days ago
After thirty years of software development, the one principle that keeps recurring is Donald Knuth's "Premature optimization is the root of all evil".

It applies on so many levels, including whether to go all in on any software engineering methodology. For instance, applying SOLID principles to your personal side project is counter-productive; but if it grows into a multi-developer project you might well gain efficiencies by rationalising your code structure.

2 comments

Yep. As another old-timer, pretty much the only principles I have seen that consistently pay off are KISS and YAGNI. And the problem is nearly all of this SOLID type stuff is directly contrary to that.
I've found it important to include the context of that quote:

> We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.

That 3% can be significant.

Yes, I’ve had to find a new job many times because we waited too long to fix real problems that hampered our ability to make progress.
Sounds interesting, could you elaborate? Why did you have to find a new job? What were the problems that ruined your project?
If my competitor can add features faster than us then they will pull ahead and there’s very little we can do about it.

I’ve been on both sides of that. Sometimes on the same project (quick hacks up front leading to calcification and death).

If each feature takes longer than the last one it becomes hell, and you don’t really want to stick around for that.