From: cross@spitfire.i.gajendra.net   
      
   In article <1084fca$afbj$3@dont-email.me>,   
   Simon Clubley wrote:   
   >On 2025-08-19, Dan Cross wrote:   
   >>   
   >> Even now, it's still an interesting read. I like my own code   
   >> princples, as well, but of course, I'm biased:   
   >> https://pub.gajendra.net/2016/03/code_principles   
   >>   
   >   
   >I've just read through that document and agree with everything there.   
   >I was especially amused by the write for readability and it will be   
   >read many times comments as I use that wording myself.   
   >   
   >I am surprised you are picking me up on some things however, given   
   >the mindset expressed in that document. Perhaps your idea of readability   
   >is different from mine. :-)   
      
   Oh, I hope any criticism I offer doesn't come across as   
   personal!   
      
   One of the harder things about programming is how much matters   
   of style, readability, and so on, are open to subjective   
   interpretation, and how these vary from language to language.   
      
   My general rule is, when working in any given language, find out   
   if there is some dominant style preferred by the bulk of   
   programmers working in that language, and adhere as closely to   
   that as I can; a decent metric is looking at the standard   
   library code for the language.   
      
   If an automated formatter exists for the language, then use it   
   aggressively, and with as close to a "stock" format as possible.   
      
   This is just part of learning the idioms of that language.   
      
   I think there is something of a generational divide when it   
   comes to this kind of thing. I've found that folks who've been   
   around longer tend to feel very strongly about using their   
   preferred coding styles, whereas newer programmers tend to care   
   much less, expecting that there is some tool automate the   
   process.   
      
   When the Go language was being developed, one of the best things   
   they did as a service to the community was declare that only   
   programs as emitted by the standard `gofmt` tool were valid. It   
   instantly eliminated entire categories of silly arguments. It   
   is truly liberating.   
      
   I suspect this was informed by the authors' experiences at   
   Google. When I started working there, I absolutely _loathed_   
   the style "guides", which are not so much guides as sets of hard   
   rules, that were in use for each language. C++ in particular   
   was just ugly. However, a few months in, I simply stopped   
   noticing and thus I stopped caring, and moreover I couldn't deny   
   the network effects of being able to change into any directory   
   of G's massive source monorepo and read, essentially, any source   
   file with no cognitive overhead based on style differences.   
      
   When you are working in code bases measured in the BLOC, that's   
   essential.   
      
    - Dan C.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|