News for hackers. Stuff that matters.
Re:What every compiler writer should know about programmers ... by adwn on Friday March 04, 2016 @03:17AM (#11222625)
Independent of undefined behavior: Who writes such god-awful code?

There:

    for (k=0; k < 16; k++)
    {
      dd = d[k];
      satd += (dd < 0 ? -dd : dd);
    }
Just one more line, less error-prone, idiomatic for-loop and variable accesses (therefore easier and faster to comprehend), and best of all: no undefined behavior.

("But if my code is simple, how will other people know what a genius I am?")

There's no way I would accept the code from that benchmark in a code review.

There are no comments on this comment yet.