From owner-freebsd-hackers Sun May 18 23:25:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA05379 for hackers-outgoing; Sun, 18 May 1997 23:25:31 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id XAA05374 for ; Sun, 18 May 1997 23:25:22 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id HAA04051; Mon, 19 May 1997 07:47:26 +0200 From: Luigi Rizzo Message-Id: <199705190547.HAA04051@labinfo.iet.unipi.it> Subject: Variable initialization To: bde@zeta.org.au (Bruce Evans) Date: Mon, 19 May 1997 07:47:26 +0200 (MET DST) Cc: hackers@freebsd.org In-Reply-To: <199705190329.NAA29656@godzilla.zeta.org.au> from "Bruce Evans" at May 19, 97 01:28:51 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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/ _____________________________|______________________________________