From: cross@spitfire.i.gajendra.net   
      
   In article <108tbg1$29q30$1@dont-email.me>,   
   Arne Vajhøj wrote:   
   >On 8/29/2025 5:44 PM, Dan Cross wrote:   
   >> 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?   
   >   
   >Not being an expert.   
      
   Aha. So now we're back to my question, "for whom are we writing   
   this code?"   
      
   In some code bases, it's acceptable to say, "not for experts."   
   In others, less so. That is to say, there are some code bases   
   which are not meant for non-experts. In that case, one should   
   bias towards writing code for experts, not for novices.   
      
   Btw, you snipped the rest of the context, particularly the part   
   where I wrote, "this is unlike the rest of the code base" (or   
   words to that effect). Often times, similarity to existing code   
   is frankly more important than whether one puts parentheses   
   around _every_ boolean expression.   
      
   >There are experts that like to drizzle parenthesis's out   
   >over the code.   
   >   
   >There are experts that do not like to drizzle parenthesis's out   
   >over the code.   
   >   
   >There are no experts that has never heard of the practice of   
   >drizzling parenthesis's out over the code.   
      
   But there are experts who look at that, realize that this code   
   was not written for experts, and be slowed down wondering why   
   novices are messing with something that they should not, without   
   a lot of supervision.   
      
    - Dan C.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|