5 ms·
The thrust is that Hoare's statement has been misapplied (I agree!) but even moreso: just because someone said it, and someone famous repeats it, does not mean
by Gunax 4y ago
The thrust is that Hoare's statement has been misapplied (I agree!) but even moreso: just because someone said it, and someone famous repeats it, does not mean it's true.
The statement is really a bit of a tautology: what is 'pre-mature' afterall? Well, it's any optimization that is not going to bear fruit for the user.
So the statement might as well be 'optimizations which do not improve the user experience do not improve the user experience'.
I see these sort of statements a lot. 'dont add too much salt', or 'dont drive too fast'. They dont really say much other than 'there is some max point which should not be exceeded'.
I guess my point is that it doesn't really guide us. Of course any 'pre-mature' optimization is not useful. The difficulty is knowing whether it's pre-mature, which can only gained through experience.
I think the reality is that optimizing code is not-fun. Adding features is fun. Writing tests is not-fun. If given the chance, we will find excuses to avoid the not-fun parts of software.
- userbinator 4y agoI think the reality is that optimizing code is not-fun. Adding features is fun. Writing tests is not-fun. If given the chance, we will find excuses to avoid the not-fun parts of software. To what is unfortunately a minority, it's the exact opposite. I enjoy optimising existing code more than adding new code.
- jasmer 4y agoYou'll know it when you see it. My gosh man the things I tried to do as a young Eng. myself - some of the tedious things I did to avoid copying strings or this or that! It's hard to see how such things add to 'complexity' in a way that slows down the project. 'Keep it Idiomatic' is a great way to keep things moving and as things become problematic, they can be tweaked. Obviously in some cases that's not going to work.