All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] Why keeping lines commented out via #if 0?
Date: Sun, 03 Jun 2007 09:12:04 +0000	[thread overview]
Message-ID: <466285E4.2030603@gmail.com> (raw)
In-Reply-To: <200706021359.23564.lists-receive@programmierforen.de>

On 06/02/2007 05:29 PM, Robert P. J. Day wrote:

> On Sat, 2 Jun 2007, Matthew Wilcox wrote:

>> Why are comments considered useful, yet commented-out sections of
>> code considered worthy of deletion?
> 
> gee, matt, i dunno ... could it be that, if some code has been deleted
> via "#if 0", it might actually no longer have any value?  could *that*
> be it?

No ofcourse it could not. If it didn't have any value any longer it would have 
been deleted, not turned into a comment.

The value #if 0 code generally retains is documentation. Documentation on how 
things were done before and/or could be done in the future, but are not done 
now. It's documentation for the current developer but even more importantly, a 
future developer. Any "I tried this, but this didn't work quite right yet" or 
"I'd like to do it this way, but this needs something else first" or similar 
information this conveys is very useful, especially over maintainer changes.

Ofcourse, noone should go overboard with it but people don't. If something has 
no value anymore, it's deleted. It's only kept as a comment when it _is_ seen to 
have value in some or other form and as such deleting it is not a janitorial 
task but something that needs a maintainer. If the code sees active maintainance 
it still being there already means it's seen to still have value and if the code 
does not, it should most certainly be left alone as documentation for a possible 
next person stepping in.

A suggestion that any #if 0 code should preferably have a comment describing why 
it's there would ofcourse not be bad.

Rene.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2007-06-03  9:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-02 11:59 [KJ] Why keeping lines commented out via #if 0? Andi Drebes
2007-06-02 13:15 ` Robert P. J. Day
2007-06-02 14:59 ` Matthew Wilcox
2007-06-02 15:29 ` Robert P. J. Day
2007-06-02 15:47 ` Matthew Wilcox
2007-06-02 16:48 ` Robert P. J. Day
2007-06-02 18:00 ` Andi Drebes
2007-06-02 18:13 ` Arnaldo Carvalho de Melo
2007-06-02 18:31 ` Andi Drebes
2007-06-02 18:47 ` Thomas De Schampheleire
2007-06-03  8:09 ` Robert P. J. Day
2007-06-03  9:12 ` Rene Herman [this message]
2007-06-03 10:47 ` Andi Drebes
2007-07-02 10:43 ` Vegard Nossum
2007-07-02 11:07 ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466285E4.2030603@gmail.com \
    --to=rene.herman@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.