home bbs files messages ]

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

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

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

   Message 263,083 of 264,096   
   Dan Cross to arne@vajhoej.dk   
   Re: extending MySQL on VMS   
   24 Aug 25 23:32:32   
   
   From: cross@spitfire.i.gajendra.net   
      
   In article <108dm7k$2fi6h$5@dont-email.me>,   
   Arne Vajhøj   wrote:   
   >On 8/19/2025 1:26 PM, Dan Cross wrote:   
   >> And despite the old admonition to make everything a symbolic   
   >> constant, things like `2 * pi * r` are perfectly readable, and   
   >> I'd argue that `TWO * pi * r` are less so.   
   >   
   >I would say that TWO and 2 are the same regarding readability.   
   >   
   >The problem with TWO is not readability, but lack of purpose.   
      
   Hence why it's poor from a readability perspective: it adds   
   nothing, just a symbolic, alphanumberic label for a number, but   
   that number is perfectly understandable, and in context, taken   
   from a  universal mathematical truth.   
      
   >There are two good reasons to introduce symbolic names for constants:   
   >1) The name can be more self documenting than a numeric value   
   >2) If the constant is used multiple places, then having a symbolic   
   >    name makes it easier to change the value   
   >   
   >But neither applies.   
   >   
   >TWO does not provide more information than 2.   
      
   Just so.   
      
   >And it would be very unwise to change the value of TWO   
   >to something different from 2.   
      
   Indeed.  Also, in a language like Rust, where all constants   
   must have a type, a name like "TWO" is too generic; supposing I   
   wanted to use such a constant in multiple contexts involving   
   different types, this wouldn't work with the type inference   
   rules, which would be unidiomatic.   
      
   	- Dan C.   
      
   --- 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