From: Lino Sanfilippo
Sent: 04 November 2016 20:07
...
In this case it is IMHO rather the declaration + initialization that make=
s
"bar" hard to find at one glance, not the use of RXT. You could do someth=
ing like
=20
[longish list of reverse xmas tree identifiers...]
struct foobarbaz *qux;
struct foo *bar;
=20
bar =3D longish_function(args, ...);
=20
to increase readability.
=20
Personally I find it more readable to always use a separate line for init=
ializations
by means of functions (regardless of whether the RXT scheme is used or no=
t).
I find it best to only use initialisers for 'variables' that are (mostly) c=
onstant.
If something need to be set to NULL in case a search fails, set it to NULL
just before the loop.
Don't put initialisation on the declaration 'because you can'.
Difficulty in spotting the type of a variable is why (IMHO) you should
but all declarations at the top of a function
(except, maybe, temporaries needed for a few lines).
David