I have the unfortunate habit of spending quite a lot of time on each of the projects I undertake. Now in some ways this is good but it does mean that some of the things I see on the projects I am part of may just be isolated incidents.
One of the sayings I hear quite often is ‘don’t prematurely optimise’. Whilst I agree with this in general like everything taken to an extreme it can lead to some unwanted effects.
Taking the prematurely optimise but measure and and then optimise can mean that people stop writing efficient code and worse almost deliberately write inefficient code – it is easier to do several string manipulations one at a time than scan a string once. Sometimes this is fine but within the context of a text heavy high request rate web site these things can be a real bottleneck.
So during your next refactoring cycle – think about the performance of the code you are changing as well as how well it reads and fits in with the architecture. Not a lot of time but just stop and say is this code reasonably efficient.