Deutsch   English   Français   Italiano  
<vsop83$3k0rp$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!eternal-september.org!.POSTED!not-for-mail
From: Muttley@DastardlyHQ.org
Newsgroups: comp.lang.c
Subject: Re: "A diagram of C23 basic types"
Date: Fri, 4 Apr 2025 14:10:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <vsop83$3k0rp$1@dont-email.me>
References: <87y0wjaysg.fsf@gmail.com> <vsj1m8$1f8h2$1@dont-email.me>
 <vsj2l9$1j0as$1@dont-email.me> <vsjef3$1u4nk$1@dont-email.me>
 <vsjg6t$20pdb$1@dont-email.me> <vsjjd1$23ukt$1@dont-email.me>
 <vsjkvb$25mtg$1@dont-email.me> <vpdHP.1828825$TBhc.94105@fx16.iad>
 <vslhrm$7uv3$1@dont-email.me> <vsll4b$8mfb$3@dont-email.me>
 <vslq6b$ginf$1@dont-email.me> <vsm45d$ncfh$4@dont-email.me>
 <vso9fa$34vau$1@dont-email.me>
 <vsogcq$3b14s$2@dont-email.me>
Injection-Date: Fri, 04 Apr 2025 16:10:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c4d4e4980b3de0ab40f443eec29dc220";
	logging-data="3801977"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18PmuyEb0XnPJMT3NbOjnbt"
Cancel-Lock: sha1:hz2LM6hGFh8Z0ER2AZJHoh1uzYA=
Bytes: 3658

On Fri, 4 Apr 2025 13:39:06 +0200
David Brown <david.brown@hesbynett.no> wibbled:
>On 04/04/2025 11:40, Muttley@DastardlyHQ.org wrote:
>> On Thu, 3 Apr 2025 15:58:05 +0200
>> David Brown <david.brown@hesbynett.no> wibbled:
>>> Human readers prefer clear code to comments.  Comments get out of sync -
>>> code does not.
>> 
>> Thats not a reason for not using comments. 
>
>It is a reason for never using a comment when you can express the same 
>thing in code.
>
>If that's your problem, write better code - not more comments.

Ah, the typical arrogant programmer who thinks their code is so well written
that anyone can understand it and comments arn't required. Glad I don't have
to work on anything you've written.

>
>Comments should say /why/ you are doing something, not /what/ you are doing.

Rubbish. A lot of the time what is being done is just as obtuse as why.

>> Except its not unreachable is it?
>
>It /is/ unreachable.  That's why I wrote it.

Really?

int main()
{
	colour_to_hex(10);
	return 0;
}

You have no idea how someone might try and use that function in the future.
Just assuming they'll always pass parameters within limits is not just 
cretinous, its dangerous.

>>  There's nothing in C to prevent you
>> calling that function with a value other than defined in the enum so what
>> happens if there's a bug and it hits unreachable?
>
>There's nothing in the English language preventing me from calling you a 
>"very stable genius" - but I can assure you that it is not going to happen.

Poor analogy.

>> Oh thats right , its
>> "undefined" ie , a crash or hidden bug with bugger all info.
>
>Welcome to the world of software development.  If I specify a function 
>as working for input values "red", "green", and "blue", and you choose 
>to misuse it, that is /your/ fault, not mine.  I write the code to work 
>with valid inputs and give no promises about what will happen with any 
>other input.

Its your fault if it dies in a heap with no info or worse returns but does
some random shit. Any well written API function should do at least basic 
sanity checking on its inputs and return a fail or assert unless its very low 
level and speed is the priority eg strlen().

But then you're arrogant, so no surprise really.

>> Also FWIW, putting seperators in the hex values makes it less readable to me
>> not more.
>> 
>
>Again, that's /your/ problem.

See above.