A Gross Overgeneralization

From David Chisnall:

If you find yourself optimizing your code, then it means that the author of your compiler has failed.

This is just very, very untrue. Even if you strike algorithmic optimization from the picture, code optimization is still a very important and useful skill to have no matter what sort of programming you’re doing. Knowing your target platform, knowing the behavior of your compiler or interpreter, and knowing your data (hat tip again to Mike Acton for driving this point home to me) can provide you with ideas on how to transform your code and realize massive performance gains.

If you’re writing performance-critical code, no compiler is going to do everything for you – the best optimizer is still between your ears. The idea that poorly-performing code can be blamed on the compiler is simply naïve and defeatist.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.