From: robin_listas@es.invalid   
      
   On 2026-01-06 20:35, Peter Flass wrote:   
   > On 1/6/26 08:15, Lars Poulsen wrote:   
   >> [Note Followup-To]   
   >>   
   >> On 2026-01-06, Carlos E.R. wrote:   
   >>> My C teacher said it was a mistake to use C as an all purpose language,   
   >>> like for userland applications. Using C is the cause of many bugs that a   
   >>> proper language would catch.   
   >>>   
   >>> That was around 1991.   
   >>>   
   >>> He knew. He participated in some study tasked by the Canadian government   
   >>> to study C compilers, but he could not talk about what they wrote.   
   >>   
   >> I agree that C does the job reasonably well, and it is simple.   
   >> And so, like most other geeks my age, I write with the tools I   
   >> have used in forever, rather than spending my time learning new   
   >> tools. For me, those tools are:   
   >> - C   
   >> - vim   
   >> - perl   
   >> - HTML (1.0)   
   >> And yes, it is like using a vintage Jeep for a daily driver.   
   >>   
   >> The most egregious problem with old C is string handling.   
   >> A useful "string" type would have   
   >> - a maximum length, using hardware (exception) bounds checking.   
   >> to be useful, this would mean a length field in front of   
   >> the char[]   
   >   
   > This is now called "Pascal strings", but PL/I had it first.   
      
   Yes, but those store the size of the used string as the first byte. We   
   also need the maximum size of the string variable. The compiler knows.   
      
   Turbo Pascal generated code to check the bounds of a variable in runtime   
   and aborted the program if surpassed. I was amazed at seeing production   
   code disabling the check (for speed?).   
      
   ...   
      
   --   
   Cheers, Carlos.   
   ES🇪🇸, EU🇪🇺;   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|