Sujet : Re: The joy of FORTRAN
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 02. Mar 2025, 10:39:23
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vq190b$n7hp$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla Thunderbird
On 02/03/2025 05:17, c186282 wrote:
So :
if(x>y)
{
.....
}
else
{
.....
}
I pref to not put the leading bracket on the
same line as the 'if' or 'else' because then
it's easier to pick out the block by eye -
just look for the '{' on the left.
if(x>y)
{
.....
} // end of if clause
else
{
.....
} //end of else clauses
Because it clearly identifies the two branches by making them differently indented
And in fact these days with inline functions
if(x>y)
fubar(x,y,z);
else
rabuf (z,y,x);
Is even shorter and allows the program flow rather than the implementation to be seen clearly.
I wonder if compilers actually inline functions that are only called once.
Most of my functions ARE called only once.
They are there to perform specific tasks, like initialise hardware or connect the wi fi.
-- “But what a weak barrier is truth when it stands in the way of an hypothesis!”Mary Wollstonecraft