[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0609061716260.18840@turbotaz.ourhouse>
Date: Wed, 6 Sep 2006 17:22:13 -0500 (CDT)
From: Chase Venters <chase.venters@...entec.com>
To: Pavel Machek <pavel@....cz>
cc: "Randy.Dunlap" <rdunlap@...otime.net>,
Takashi Iwai <tiwai@...e.de>, Andrew Morton <akpm@...l.org>,
kernel list <linux-kernel@...r.kernel.org>, perex@...e.cz,
alsa-devel@...a-project.org, pshou@...ltek.com.tw
Subject: Re: CodingStyle (was: Re: sound/pci/hda/intel_hda: small cleanups)
On Wed, 6 Sep 2006, Pavel Machek wrote:
> Hi!
>
>>> +comment out unused code.
>>> +
>>
>> Is there an acceptable way to leave source code in a file but
>> render it unused? Like #if 0/#endif or #if BOGUS_SYMBOL/#endif ?
>
> I'd say "no way is acceptable, but #if 0/#endif is least evil" :-).
I'd say "no way is acceptable, but #if 0/#endif with proper comments is
less evil."
Disabled code will never break if other parts of the code change
without it; rather, it could just become plain wrong. People might either
leave it alone (if they don't know what it is for) or try to change it (if
they think they do).
If you must leave disabled code behind (which in my perfect world would be
'never'), you should at least leave behind a comment explaining what the
code is supposed to do and why it isn't enabled.
If it starts to drift from almost-functional to plain wrong, it becomes an
even worse wart than it originally was.
Thanks,
Chase
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists