Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is a tautology because the word "premature" means "before you have to" in this context. It's like saying "You don't need to do things before you need to need to do them." It's true by definition.

The question is: which optimizations are premature and which aren't?



I'd say it's not only a tautology, it's plain false.

Cheap optimizations that are known to work (compiling in release mode, enabling HTTP cache in your web server, using a fast sorting algorithm on large arrays...) are good even if you don't need them right now.


> I'd say it's not only a tautology, it's plain false.

And that, my friends, is a contradiction!


That would mean they aren't premature


But the question still valid, which are and which aren't (premature)? For experts: avoiding n+1 query, using hash map rather than loop match, caching in memory, using smaller data type, all are standard optimization techinques.

Now if junior doesn't implement them, are they didn't do required optimization, or do they do premature optimization if they did?


"premature" is in the eye of the beholder... (or implementer). I've cleaned up a lot of slow code over the last few years, and in most cases the 'fixes' are pretty simple. The pushback was typically along the lines of "YAGNI" and "premature optimization is the root of all evil" quotes, yet... yeah, you know what, we ARE "gonna need it", and adding a table index on a column you're querying on in a where clause isn't "premature". It's industry standard practice.


You don’t NEED them. They are premature. I don’t technically need to compile my app in release-mode as a small startup.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: