You are a stupid programmer, you can't have that

Mark mt.rzezniczak at gmail.com
Mon Aug 9 16:14:49 UTC 2021


On Monday, 9 August 2021 at 15:15:53 UTC, bachmeier wrote:
> On Saturday, 7 August 2021 at 12:15:15 UTC, IGotD- wrote:
>
>> Somewhat related. when Java was designed, the designer (James 
>> Gosling I believe) claimed that programmers were too stupid to 
>> understand the difference between signed and unsigned math 
>> (despite often several years of university education) and 
>> removed signed math entirely from the language. The impact is 
>> that when unsigned math is required, you are forced to 
>> conversions and library solutions. Not ideal when an HW APIs 
>> deals with unsigned numbers for example.
>
> Programmers are humans that write programs. I've surely written 
> more than a million lines of code in my life (who knows how 
> much, but that's definitely a lower bound) and I did not study 
> unsigned math in college. I took one programming class and I've 
> done a lot of independent study. Maybe I could figure out how 
> to work with unsigned math, but why would I want to? I have 
> better things to do with my time.
>
> But set all that aside. Anyone that's taught a university class 
> will agree that you can't assume someone understands something 
> just because they attended a lecture and took a test over it.
>
> I don't necessarily disagree that there are *some* cases of 
> overly restrictive language design. I didn't last very long 
> with Go for that reason. I just think unsigned math is not the 
> best example. Switching to safe by default would be a better 
> example.

Isn't unsigned math exist because we are limited in how many bits 
the number can hold? There's no concept of signed/unsigned for 
float/double/real. Which one is simpler that would introduce less 
complexity for the programmer writing code?


More information about the Digitalmars-d mailing list