A
Arved Sandstrom
The one optimization that makes sense at initial coding time, beforeSend him back to the 9970's or 1980's - there were great use
for developers like him back then.
Today that type of stuff typical make large chunks of code
unreadable and saves little on overall execution time.
But you may find it difficult to convince him. Microoptimizers
believe very strongly in their religion.
You can suggest every time he wants to change something that
you measure the real application before and after the change.
My guess is that he will find an excuse for not doing that and
refer to his own micro-benchmark.
Arne
profiling, and improves execution time also by-the-by, does relate to
how many objects you create in one implementation approach versus another.
What I'm really getting at here is things like thinking about scope of
objects, how Strings are built, what's happening in loops etc. This is
not micro-optimization, like the silly stuff raised by the OP, but just
good coding. Not observing certain "optimizations" (read "being sloppy
with object creation") can bring a JVM to its knees if it's running an
app server with several apps, and only 4 or 8 gigs of RAM are available.
Invariably, when I've cleared up object creation problems, I've sorted
execution speed problems too.
All of the stuff I suggest is the type of optimization that is discussed
in good programming books as good programming, and it certainly does not
make the program less clear or less maintainable. It's also not Knuthian
premature optimization.
AHS