Slashdot Mirror


User: beacker

beacker's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. Re: Clearer code on Optimizations - Programmer vs. Compiler? · · Score: 1
    I'll show my age here and state that I've been using 'C' for over a quarter of a century (for those who don't understand such archaic terms, that's 25 years :). I still have a raggedy old "C Programming Language" book by Kernighan and Ritchie that I picked up in '80.

    With regard to (!ptr) vs (ptr == NULL), I will state the latter may look clearer, but is more prone to the = vs == error that has bitten too many programmers over the decades this language has been in existence.

    I personally prefer the !ptr because my history includes over 13 years working inside the Un*x kernel at a half dozen computer manufacturers. During that time the == (double equals) typo has burned me more times than I care to remember.

    When it comes to optimization, I go back to my days with MIPS where the optimizer will rearrange code to fill empty branch delay slots of that architecture with useful instructions from earlier in the code path that don't have dependencies. Debugging at that level was always an adventure, with or without compiler optimizations.