Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 1997 07:47:26 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        hackers@freebsd.org
Subject:   Variable initialization
Message-ID:  <199705190547.HAA04051@labinfo.iet.unipi.it>
In-Reply-To: <199705190329.NAA29656@godzilla.zeta.org.au> from "Bruce Evans" at May 19, 97 01:28:51 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Besides, style(9) explicitly says not to obfuscate code by initializing
> variables in declarations.  This obfuscation should only be used
> thoughfully. :-).

Can someone tell me why this is called obfuscation ? It seems to me
that the most natural place to initialize variables is in their
declaration. Ok there might be some confusion in understanding what is
the initialization order, or it might be slightly less efficient when
some variables are in fact not used, but for sequences such as

	int a, b, c;

	a = 0 ;
	b = 1 ;
	c = 3 ;

it seems to me the cleanest way. At least one is sure not to forget
initializations.

	Cheers
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705190547.HAA04051>