From owner-freebsd-hackers Mon May 19 02:24:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA11380 for hackers-outgoing; Mon, 19 May 1997 02:24:06 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id CAA11344; Mon, 19 May 1997 02:22:52 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id KAA13611; Mon, 19 May 1997 10:57:03 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id KAA04023; Mon, 19 May 1997 10:47:10 +0200 (MET DST) Message-ID: <19970519104709.FO31408@uriah.heep.sax.de> Date: Mon, 19 May 1997 10:47:09 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Cc: core@FreeBSD.ORG Subject: Re: Variable initialization References: <199705190329.NAA29656@godzilla.zeta.org.au> <199705190547.HAA04051@labinfo.iet.unipi.it> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199705190547.HAA04051@labinfo.iet.unipi.it>; from Luigi Rizzo on May 19, 1997 07:47:26 +0200 Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Luigi Rizzo wrote: > > 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 ? No, and it's one of the points where not much of an agreement could be reached even among the core team. Initializing a variable when it's being declared (and not later) is even more crucial if it comes to C++, since it technically makes a big difference there. Just declaring it means the default constructor is called (which must not exist, that will result in an error), while the appropriate constructor will be called if it's initialized immediately. To the very least, this could save quite some useless default initialization (like bzero'ing areas that are about to be filled in a millisecond later). I've cc'ed the core team: we should IMHO make this sentence in style(9) less strict. My English ain't good enough for a better formulation... -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)