Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <v6pdcf$2jijk$1@dont-email.me>
Deutsch   English   Français   Italiano  
<v6pdcf$2jijk$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: =?UTF-8?Q?Re=3A_technology_discussion_=E2=86=92_does_the_world_need?=
 =?UTF-8?B?IGEgIm5ldyIgQyA/?=
Date: Thu, 11 Jul 2024 20:56:00 +0100
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <v6pdcf$2jijk$1@dont-email.me>
References: <v66eci$2qeee$1@dont-email.me> <v6f7vg$hgam$1@dont-email.me>
 <20240707164747.258@kylheku.com> <v6gl83$s72a$1@dont-email.me>
 <v6h8ao$ur1v$1@dont-email.me> <v6jhk3$1drd6$1@dont-email.me>
 <v6jiud$1dsjb$1@dont-email.me> <877cdur1z9.fsf@bsb.me.uk>
 <v6joi4$1epoj$1@dont-email.me> <871q42qy33.fsf@bsb.me.uk>
 <v6k6i0$1h4d3$1@dont-email.me> <87ed82p28y.fsf@bsb.me.uk>
 <v6m03l$1tf05$1@dont-email.me> <87r0c1nzjj.fsf@bsb.me.uk>
 <v6m716$1urj4$1@dont-email.me> <86ikxd8czu.fsf@linuxsc.com>
 <v6mggd$20g3f$1@dont-email.me> <20240710213910.00000afd@yahoo.com>
 <v6mm02$21cpb$1@dont-email.me> <865xtc87yo.fsf@linuxsc.com>
 <v6ol14$2fdrj$1@dont-email.me> <87msmnu5e3.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Jul 2024 21:56:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92757c0b3eb137c08e71ba54311788f0";
	logging-data="2738804"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+61bMhojgM/Xc8demwZGPW"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1gP652CJDmG93DSl/xMud5BraHY=
In-Reply-To: <87msmnu5e3.fsf@nosuchdomain.example.com>
Content-Language: en-GB
Bytes: 3876

On 11/07/2024 19:53, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:
> [...]
>> For that purpose, in the mind of the user, it does the same job as 'by
>> by reference'. That it does so by some other quirks (array decay, and
>> the ability to index pointers as thought they were arrays), is by the
>> by.
> [...]
> 
> Those "quirks" are a rich source of confusion and bugs for anyone who
> doesn't understand how this stuff is actually defined.  (Yes, I'm
> acknowledging, yet again, that the way C specifies its treatment of
> arrays is confusing.)
> 
> A user who thinks that arrays are simply "passed by reference" is likely
> to try to apply sizeof to an array parameter (and might or might not get
> a diagnostic from the compiler).  A slightly more sophisticated user is
> still likely to be unsure of just where the "quirks" are.
> 
> What have you ever done to help make that kind of error less likely?
> What is your goal?


This my first comment on the subject:

"Arrays are passed by reference:
   ...
Although ..."


(Note that 'Although'.) And the first reply was:

BB:
"All parameter passing in C is by value.  All of it."

And there's been no let up since then.

Nobody has acknowledged that there's more going on with passing array 
types than it simply being due to 'pass by value', if it's not full 
'pass by reference'.

The language could have helped a little by making this invalid:

    int A[20];

    void F(int B[20]) {}

The type of B looks just like that of A, but it isn't; the T[N] type is 
silently changed to T*. The language could insist that you write:

    void F(int* B) {}

This way, it is far clearer that a pointer is being passed, and 'pass by 
value' now makes more sense. The way B will be used is now consistent 
with the same declaration anywhere else.

My goals might be to make the language a little more accessible, 
although that cuts little ice here where most are C experts of long 
standing; they won't know or will have forgotten what it's like to be a 
beginner or outsider, or coming to C from saner languages.

However I use /my/ saner language every day.