A
Andreas Leitgeb
Arne Vajhøj said:Yep.
Is it just me, or do others feel alike, that the above two
paragraphs contradict each other? ("just let the compiler(JIT)
do it's job" versus "use explicit StringBuilders for loops
instead of s+=...")
PS: leaving aside, that others (excluding me) may consider the explicit
StringBuilder to be just "clear code" in contrast to "s+=...;".
PPS: and surely, the JIT also will never be able to replace a
handcoded bubblesort with a mergesort, so I find this overly
trusting the optimizer to be rather misguided. (of course,
the recommendation for profiling before handoptimizing still
holds.)