From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Received: (qmail 18236 invoked from network); 11 Nov 2002 21:16:44 -0000 Received: from unknown (HELO jareth.dreamhost.com) (66.33.198.201) by sources.redhat.com with SMTP; 11 Nov 2002 21:16:44 -0000 Received: from hug.dreamhost.com (basic-cabo.hug.dreamhost.com [66.33.198.140]) by jareth.dreamhost.com (Postfix) with ESMTP id 09CD16B5F8 for ; Mon, 11 Nov 2002 13:16:44 -0800 (PST) Received: from paper-wolf-solo.tigerfood.org (localhost [127.0.0.1]) by hug.dreamhost.com (8.11.0/8.9.3/Debian 8.9.3-21) with ESMTP id gABLGiV18527 for ; Mon, 11 Nov 2002 13:16:44 -0800 Received: from tigerfood.org (flee@localhost) by paper-wolf-solo.tigerfood.org (8.11.6/8.11.6) with ESMTP id gABLGeB03251 for ; Mon, 11 Nov 2002 13:16:41 -0800 Message-Id: <200211112116.gABLGeB03251@paper-wolf-solo.tigerfood.org> X-Authentication-Warning: paper-wolf-solo.tigerfood.org: flee owned process doing -bs From: Felix Lee Subject: Re: PATCH: Remove unnecessary zero-initializations To: gdb-patches@sources.redhat.com In-reply-to: <20021111143426.GA26740@nevyn.them.org> on Mon, 11 Nov 2002 09:34:26 EST. Date: Mon, 11 Nov 2002 17:15:00 -0000 X-SW-Source: 2002-11/txt/msg00319.txt.bz2 Daniel Jacobowitz : > Certainly it's a style issue. However, it's an awkward style issue and > anyone implementing a target should be looking over the complete list > of methods anyway. Of course. It's not about writing the target in the first place, it's about reading it and maintaining it later. Say, a year from now, someone adds a new method but doesn't spend all the effort necessary to make all N targets work correctly with the change, which is reasonable since it's not sensible to insist that everyone be familiar with the issues of all N targets before doing any work. Absence of an initializer is a simple indication that someone should look at it and make sure it's ok. Putting in a zero initializer is an easy sign for, "yes, this is ok". "Always initialize all members and methods" is a simple style rule that encourages good programming discipline in a couple ways, and if I were in charge I'd be adding all the missing zero initializers rather than taking away the existing ones :) I'm not sure why you call it "an awkward style issue". If a block of initializers seems long, it's because an interface is complicated, and glossing over that by making the initialization look simpler is counter-productive. The correct point to attack is the interface itself, not the places it's used. --