home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 241,292 of 243,242   
   Keith Thompson to bart   
   Re: Nice way of allocating flexible stru   
   09 Oct 25 20:59:26   
   
   From: Keith.S.Thompson+u@gmail.com   
      
   bart  writes:   
   > On 09/10/2025 04:49, BGB wrote:   
   [...]   
      
   > Nobody cares about C syntax.   
      
   That is so manifestly untrue that I can't imagine what you actually   
   meant.   
      
   Many of us, myself included, don't particularly like some aspects of C   
   syntax, but that's not the same as not caring about it.   
      
   >                              Learning all its ins and outs seems be a   
   > rite of passage.   
      
   Perhaps.  It's also necessary if you want to work with the language.   
      
   > The trouble is that C-style is so dominant, few people would know what   
   > a decent syntax looks like. Or, more, likely, they associate a clean,   
   > well-designed syntax with toy or scripting languages, and can't take   
   > it seriously.   
   >   
   > But if it looks as hairy as C++ then it must be the business!   
      
   C syntax has survived and been propagated to other languages because   
   it's well known, not, I think, because anybody really likes it.   
      
   [...]   
      
   >> One merit is if code can be copy-pasted, but if one has to change   
   >> all instances of:   
   >>    char *s0, *s1;   
   >> To:   
   >>    char* s0, s1;   
   >> Well, this is likely to get old, unless it still uses, or allows C   
   >> style declaration syntax in this case.   
   >   
   > That one's been fixed (50 years late): you instead write:   
   >   
   >  typeof(char*) s0, s1;   
   >   
   > But you will need an extension if it's not part of C23.   
      
   Yes, that will work in C23, but it would never occur to me to   
   write that.  I'd just write `char *s0, *s1;` or, far more likely,   
   define s0 and s1 on separate lines.  Using typeof that way triggers   
   my WTF filter.   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca