| Deutsch English Français Italiano |
|
<vm8bk6$2uq21$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!eternal-september.org!.POSTED!not-for-mail
From: Julio Di Egidio <julio@diegidio.name>
Newsgroups: comp.lang.c
Subject: Re: So You Think You Can Const?
Date: Wed, 15 Jan 2025 14:01:57 +0100
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <vm8bk6$2uq21$3@dont-email.me>
References: <vljvh3$27msl$1@dont-email.me> <20250107130809.661@kylheku.com>
<vlm0hf$2dkpd$1@dont-email.me> <87a5c15ob0.fsf@bsb.me.uk>
<vlm7o4$2dkpd$4@dont-email.me> <vlm8r6$2dkpd$5@dont-email.me>
<87ldvk4wu7.fsf@bsb.me.uk> <vlnrib$2dkpc$5@dont-email.me>
<875xmn4lmy.fsf@bsb.me.uk> <vlpmkm$2dkpd$16@dont-email.me>
<vlpn39$2dkpd$17@dont-email.me> <8634hr8muh.fsf@linuxsc.com>
<vlpvpm$2dkpc$9@dont-email.me> <vlq1v6$2dkpd$18@dont-email.me>
<vm206r$1gm6l$1@dont-email.me> <vm2kk2$1n8gc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 15 Jan 2025 14:01:59 +0100 (CET)
Injection-Info: dont-email.me; posting-host="2563c1350cfe2ddd1cd2f0f3cf044725";
logging-data="3106881"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cxDsGXALPVvvp2CTHwzGUZL/4zatmDy8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SDodhmF/LEQGNsW8MJQDd+1EEPA=
Content-Language: en-GB
In-Reply-To: <vm2kk2$1n8gc$1@dont-email.me>
Bytes: 4073
On 13/01/2025 09:58, David Brown wrote:
> On 13/01/2025 04:10, James Kuyper wrote:
>> On 1/9/25 21:51, Julio Di Egidio wrote:
>>> On 10/01/2025 03:14, Julio Di Egidio wrote:
>> ...
>>>>>>>> Julio Di Egidio <julio@diegidio.name> writes:
>>>>>>>>
>>>>>>>>> On 09/01/2025 02:09, Ben Bacarisse wrote:
>>>>>>>>>
>>>>>>>>>> Julio Di Egidio <julio@diegidio.name> writes:
>> ...
>>>>>>>>>> static AvlTree_t const *AvlTree_node(
>>>>>>>>>> void const *pk, AvlTree_t const *pL, AvlTree_t const *pR
>>>>>>>>>> ) {
>>>>>>>>>> AvlTree_t *pT = malloc(*pT);
>>>>>>>>>> if (pT) {
>>>>>>>>>> pT->pk = pk;
>>>>>>>>>> pT->pL = pL;
>>>>>>>>>> pT->pR = pR;
>>>>>>>>>> }
>>>>>>>>>> return pT;
>>>>>>>>>> }
>>>>>>>>>> I'm not going to "make a case" for this (though I will if you
>>>>>>>>>> want!) -- I just think it helps to see lots of different styles.
>>>>>>>>>
>>>>>>>>> That is *more* error prone,
>> ...
>>>> ... check the return value as soon as the function returns a possibly
>>>> null pointer or an error value is certainly more widely applicable,
>>>> and quite less error prone, especially if it's
>>>
>>> I meant: immediately check the return value and bail out if needed.
>>> The other approach does not even simplify on the clean-up, by the way...
>>
>> The code you're criticizing as more error prone does check the return
>> value as soon as the function returns, and bails out if needed. It just
>> bails out through the missing else clause rather than from the if-clause.
>>
>> It does requires code to be indented farther than the other approach. I
>> have avoided writing code like that for that reason, particularly when
>> there's a lot of code inside the it statement's controlled blocks -but
>> not because it's error prone.
That's of course correct, what else.
> I'm wary of assuming a particular interpretation of what someone else
> wrote, but I would say there is a valid argument for say that the second
> style of code is more "error prone".
Because you really are a piece of nazi-retarded shit. Indeed always
self-indulgent, always self-apologetic, and always in group: you stupid
nazi-retarded fraudulent polluters of all ponds and nothing else.
> Different styles have different pros and cons, and different balances of
> emphasis. (They can also have different efficiencies in the normal and
> error cases, but that's usually less important.)
Fuck you and the fraudulent bullshi8t that floods every single fucking
public channels at this point.
-Julio