Rule 1. Don't do it
Rule 2. (for experts only) Don't do it yet.
I find it funny... reminds me of that "Early optmization is the root of much evil" quote...
I think it was "premature optimization".
I don't know when optimization reached maturity though..a pretty open ended statement, basically amounting to "don't do it".
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Depends on what exactly you mean with optimization. I think optimizing the general design and algorithms must be done as early as possible, instead of never.
But silly stuff like replacing int i = 0 with int i ^= i is stupid and must be done by the compiler.
More important than speed is IO handling, as in general IO is slow compared to the cpu, so causing it and waiting for it must be avoided. If you do a lot of IO and IO isn't the bottleneck then you must optimize to increase peformance. Though often it's more important to have good and clean code than to squeeze most out of the thing.
Oh well, there's nothing to disagree here I guess.
well I think it's a valid point... I hate when people at work are like "why do it that way when you can add all this extra crap and error checking and it'll perform better?" and I just sigh... and replace my one line implementation with about 40 lines of crap... you just don't do that unless there's a problem... optimize the bottlenecks only after they've proven to be a problem
Wait... Are you guys saying -O3 is stupid?
Because it sure as hell is.
No, this is something totally different. And -O3 isn't stupid. Using it for everything is stupid. We're talking about programmers manually optimizing their code here.