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,053 of 264,096   
   Dan Cross to arne@vajhoej.dk   
   Re: extending MySQL on VMS   
   19 Aug 25 17:26:59   
   
   From: cross@spitfire.i.gajendra.net   
      
   In article <10823ei$3pb8v$3@dont-email.me>,   
   Arne Vajhøj   wrote:   
   >On 8/19/2025 9:01 AM, Simon Clubley wrote:   
   >> On 2025-08-18, Dan Cross  wrote:   
   >>> I happen to disagree with Simon's notion of what makes for   
   >>> robust programming, but to go to such an extreme as to suggest   
   >>> that writing code as if logical operators don't short-circuit   
   >>> is the same as not knowing the semantics of division is   
   >>> specious.   
   >>>   
   >>   
   >> That last one is an interesting example. I may not care about   
   >> short circuiting, but I am _very_ _very_ aware of the combined   
   >> unsigned integers and signed integers issues in C expressions. :-(   
   >>   
   >> It also affects how I look at the same issues in other languages.   
   >>   
   >> I've mentioned this before, but I think languages should give you   
   >> unsigned integers by default, and you should have to ask for   
   >> a signed integer if you really want one.   
   >   
   >"by default" sort of imply signedness being an attribute of   
   >same type.   
   >   
   >Why not just make it two different types with different names?   
      
   I gathered Simon was referring to the type assigned to manifest   
   constants like 0, 1, or 2 (or 1024, 4096, or whatever).  What   
   type is such a literal?  Signed or unsigned?  How wide is it?   
   In C (for example) it's `int` unless it's too big to fit into an   
   `int`, in which case it's `unsigned int`.  But how big is `int`?   
   THAT depends on the target platform, and so it can be difficult   
   to reason about the semantics of a program just from reading the   
   code.   
      
   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.   
      
   >Whether we follow tradition and call them integer and cardinal   
   >or more modern style and call them int and uint is less important.   
      
   I would argue that, at this point, there's little need for a   
   generic "int" type anymore, and that types representing integers   
   as understood by the machine should explicitly include both   
   signedness and width.  An exception may be something like,   
   `size_t`, which is platform-dependent, but when transferred   
   externally should be given an explicit size.  A lot of the   
   guesswork and folklore that goes into understanding the   
   semantics of those things just disappears when you're explicit.   
      
   	- 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