Deutsch   English   Français   Italiano  
<viht27$2hgg1$3@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: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Sun, 1 Dec 2024 15:49:42 +0100
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <viht27$2hgg1$3@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vi6sb1$148h7$1@paganini.bofh.team>
 <vi6uaj$3ve13$2@dont-email.me> <87plmfu2ub.fsf@nosuchdomain.example.com>
 <vi9jk4$gse4$1@dont-email.me> <vi9kng$gn4c$1@dont-email.me>
 <87frnbt9jn.fsf@nosuchdomain.example.com> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <vifcll$1q9rj$1@dont-email.me>
 <vifiib$1s07p$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 01 Dec 2024 15:49:51 +0100 (CET)
Injection-Info: dont-email.me; posting-host="cb92292cff9a7aed5107a3020cf78af5";
	logging-data="2671105"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX189Fawh+wFqUK84ZEuHsevA04BSuR/qRUs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Ww7DhldOs9ZkgUDWYL5aEduB3qc=
Content-Language: en-GB
In-Reply-To: <vifiib$1s07p$1@dont-email.me>
Bytes: 5015

On 30/11/2024 18:38, Bart wrote:
> On 30/11/2024 15:57, David Brown wrote:
>> On 29/11/2024 19:26, Bart wrote:
> 
>>>
>>> C's syntax allows a 14-parameter function F to be declared in the 
>>> same statement as a simple int 'i'.
>>
>> And the laws of physics allow me to drop a 20 kg dumbbell on my toe. 
>> That does not mean that anyone thinks it is a good idea.
> 
> Who said it's a good idea? I merely said that C allows such disparate 
> types in declarations. You disagree that they are different types, while 
> at the same time saying it's a bad idea to mix them in the same 
> declaration!

So if we all agree that it's a bad idea, and no one does it, why is it 
such a problem for you?

> 
>>> I'd say that F and i are different types! (Actually I wouldn't even 
>>> consider F to be type, but a function.)
>>
>> Functions have types in most typed languages, including C.
>>
>> And yes, F and i are different types - but they are related types.  
>> Use the declared identifier in an expression of a form matching what 
>> you wrote in the declaration, and the expression will have type "int". 
>> That's how C's declarations work.
> 
> That's not how people's minds work.

Are you extrapolating from how /you/ think, to how everyone else (or at 
least, every other C programmer) thinks?  Given the negligible support 
you have here for most (though not all) of your multitudes of pet hates 
in C, I think that's a rather bold approach.

> If you declare A, B, and C, then 
> what is important is the types of A, B, and C, not what might yielded as 
> they result of some expression.
> 

Why do you think that?  After all, A, B and C are going to be used 
primarily in those types of expression.  If "A" is an array, you will 
use it as "A[i]" in the majority of cases - and care about the type of 
"A[i]" more than the type of "A".

Note - in case you missed it - that personally I would prefer if C did 
not allow declaring identifiers of different types together.  And I 
would probably have preferred a declaration syntax where the identifier 
comes either fully before, or fully after, all type-related symbols.

But C is defined the way it is defined, and with good logical 
justification.  Most C programmers find it helpful to understand that.

>>> With the kind of C I would write, you could discard everything after 
>>> C99, and even half of C99, because the subset I personally use is 
>>> very conservative.
>>>
>>
>> You say that as though you think it is a good thing - it is not.
> 
> Why?
> 
> I reckon people will have an easier type understanding and working with 
> my code than yours.

You are joking, right?  If you are not lying about how confusing you 
find C and how error-prone you think it is, then your C code works by 
luck.  And that is not something people are going to find easy to 
understand.  (And if you are talking about your own language, then no 
one else understands it.)

> It will at least work with more compiles.
> 

And why would that matter?  No actual developer would care if their code 
can be compiled by your little toy compiler, or even more complete 
little tools like tcc.  Code needs to work on the compilers that are 
suitable for the job - compatibility with anything else would just be a 
waste of effort and missing out on useful features that makes the code 
better.