
The ‘premature optimization is evil’ myth (2010) - sea6ear
http://joeduffyblog.com/2010/09/06/the-premature-optimization-is-evil-myth/
======
nkurz
_A colleague of mine used to call C a WYWIWYG language— "what you write is
what you get"—wherein each line of code roughly mapped one-to-one, in a self-
evident way, with a corresponding handful of assembly instructions. This is a
stark contrast to C#, wherein a single line of code can allocate many objects
and have an impact to the surrounding code by introducing numerous silent
indirections. For this reason alone, understanding what things cost and paying
attention to them is admittedly more difficult – and arguably more important –
in C# than it was back in the good ole’ C days. ILDASM is your friend … as is
the disassembler. Yes, good systems programmers regularly look at the assembly
code generated by the .NET JIT. Don’t assume it generates the code you think
it does. _

I love it. Rehighlighting:

 _good systems programmers regularly look at the assembly code generated by
the .NET JIT._

Let's consider the percentages, and what it implies about the Joe's assessment
of programmers.

What percentage of systems programmers in any language look at the generated
assembly?

Is the percentage for .NET programmers higher or lower than the average
systems programmer?

What percentage of programmers who regularly look the generated assembly meet
the unstated "other requirements" of being a "good systems programmer"?

I can't believe it's a very high percentage that make it through this filter,
for .NET or other.

And yet I think he's right: how can one possibly be a good programmer without
understanding what the computer is actually executing? And how can you
understand what the computer is executing without looking at the assembly?

------
akshat_h
I have always felt that premature optimization is the root of all evil implied
that you will profile the code post writing and fix the bottlenecks. Also as
long as there is no impact on code clarity, I don't think writing
(prematurely)optimum code is bad.

