Liste des Groupes | Revenir à cl c |
On 1/9/25 21:51, Julio Di Egidio wrote:LOL, the convincing arguments. Tell that to your customer when things start going south: "it is formally equivalent"!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,The code you're criticizing as more error prone does check the return... 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...
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. ISure, one level for each checked call, and that's still just the tip of that iceberg: I mean, are you serious or just you too sell bullshit for a living? Not even my worst enemy I would bullshit that way.
have avoided writing code like that for that reason, particularly whenIt's called error prone when it's easy for the programmers to trip on it. Get a real education for a change.
there's a lot of code inside the it statement's controlled blocks -but
not because it's error prone.
Les messages affichés proviennent d'usenet.