From: cross@spitfire.i.gajendra.net   
      
   In article <68b2087a$0$712$14726298@news.sunsite.dk>,   
   Arne Vajhøj wrote:   
   >On 8/29/2025 9:11 AM, Dan Cross wrote:   
   >> In article <108k9de$1f69$1@dont-email.me>,   
   >> Simon Clubley wrote:   
   >>> And _this_ is an example of why Simon's policy of backets around   
   >>> everything makes it explicitly clear what was intended. :-)   
   >>   
   >> *At some expense for expert users.   
   >   
   >I doubt that.   
   >   
   >I would expect with parenthesis's:   
   >   
   >actually read expression : 2 second   
   >thinking "nice to see good craftmanship" : 1 second   
      
    if ((a == 6) || (a == 7)) {   
    // do the thing...   
    }   
      
   "Huh; I wonder why they parenthesized `a == 6` and `a == 7`....   
   the operator precedence is obvious, so what am I missing here?   
   I'd better check the surrounding code to see if there's   
   something thing that I am not accounting for here...oh god, `a`   
   isn't some kind of weird macro, is it? No...that doesn't make   
   any sense, and besides, I see it declared as an `int` 30 lines   
   up.... What was this programmer thinking? It looks like it was   
   written by someone who just read a Steve McConnell book for the   
   first time. It's actually harder to read this way, and doesn't   
   match the predominant style in the rest of the code base. Do   
   they actually know the language?"   
      
   >and without:   
      
    if (a == 6 || a == 7) {   
    // Do the thing.   
    }   
      
   "Ok. If a is 6 or if a is 7, then do the thing."   
      
   >actually read expression : 1.9 second   
   >thinking "arghh - this code looks written in hast - should I raise an   
   >issue? No - there are probably more important issues!" : 3 seconds   
   >   
   >:-)   
      
   I feel like the above is quite real, and something I've   
   encountered recently.   
      
    - Dan C.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|