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

tausy tausy at protonmail.com
Tue Aug 10 06:32:45 UTC 2021


On Saturday, 7 August 2021 at 12:15:15 UTC, IGotD- wrote:
> This is a general discussion which applies to all computer 
> languages and also under several decades. What I have observed 
> is that language designers see programmers misuse the language 
> and introduce possible bugs and therefore remove features in 
> languages. An analogy would limit the functionality of cars 
> because people sometimes are involved in accidents, like 
> automatic speed limiter (soon to be law in several countries).
>
> Language designers seem to have a big brother attitude towards 
> programmers and think they will save the world by introducing 
> limitations.
>
> Examples.
>
> 1.
> Array indexes should be signed instead of unsigned because 
> somehow programmers mess up loops among other things. Bjarne 
> Stroustrup considered his unsigned index to be a historic 
> mistake. While unsigned array indexes make perfectly sense, the 
> bias towards signed seems to be that programmers are stupid. 
> The question is, if can't make a for loop with unsigned math, 
> shouldn't you look for another job?
>
> 2.
> 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.
>
> You are welcome to add any other examples that you find 
> significant for the discussion.
>
>
> This partially applies to D in some extent but can often be 
> found in other languages and mentality of several language 
> designers.
>
> The question is, do you think language designers go to far when 
> trying to "save" programmers from misuse or not?
> Do you think there can be approaches that both prevent bugs at 
> the same time do not limit the language?

If there wasn't a need for safe and restrictive languages they 
probably wouldn't exist. I'd say like most things in this world 
the drive to make languages safe and easy is money.

https://money.cnn.com/2012/08/09/technology/knight-expensive-computer-bug/index.html

People make mistakes, even the smartest "college/university 
educated" people. As well, if I want to start a business and I 
don't need to use a systems language like C that would be nice. 
I'm sure it's cheaper for a startup to hire python developers to 
write a backend than it would be to hire C/C++ developers to do 
the same thing.

Another reason, even more important than the first, would be that 
bugs can and have killed people.

https://theinsurancenerd.com/therac-25-a-computer-bug-that-killed-many/
https://www.linkedin.com/pulse/real-world-bugs-debugging-embedded-system-stanly-christoper

I'd can probably say with certainty that the people working on 
these systems were intelligent, had a CS degree and they weren't 
using D/Go/C#/Java etc... I agree there are some languages that, 
to me, seem overly restrictive but the fact is I don't have to 
use or learn them. Imagine how restrictive a language that has 
mathematical proof that it's type safe, memory safe, runtime 
exception safe, data-race free and dead-lock free. Take a look at 
Pony. Too much for me, I'll pass. My point is that it's not that 
programmers are stupid it's just about safety.


More information about the Digitalmars-d mailing list