You are a stupid programmer, you can't have that
Paulo Pinto
pjmlp at progtools.org
Sat Aug 7 14:49:46 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?
"In programming language design, one of the standard problems is
that the language grows so complex that nobody can understand it.
One of the little experiments I tried was asking people about the
rules for unsigned arithmetic in C. It turns out nobody
understands how unsigned arithmetic in C works. There are a few
obvious things that people understand, but many people don't
understand it."
https://www.artima.com/articles/james-gosling-on-java-may-2001
Turns out not everyone has an university degree for programming,
and many known less than they actually are able to deliver,
specifically when under stress and deadlines.
By the way, Java supports unsigned math since Java 8 via unsigned
math methods, if only people would actually bother to update, we
are on version 16 now.
More information about the Digitalmars-d
mailing list