What's the word on using """ to comment-out?
spamfresser at ch3ka.de
Thu Feb 25 16:39:27 CET 2010
Am 25.02.2010 16:07, schrieb Grant Edwards:
> On 2010-02-25, Paul Rudin<paul.nospam at rudin.co.uk> wrote:
>> No idea, but it would be nice to have some multiline comment syntax
>> (other than # at the beginning of each line). Particularly one that can
>> be nested.
> if 0:
> Seriously, that's what I generally do: mark the block of code,
> indent it 1 level, add an if 0: at the top.
I really hate it when I see something like this in other's code.
The fact that my IDE (vim) still displays this like valid code ready to
be executed can cause extreme frustration while trying to spot a bug.
This is almost as bad as "commenting out" (parts of) a for loop by
adding a continue.
I once saw this in production code and wanted to kill the original
developer, as commenting out the parts of the code with the continue (it
was a *biiiig* for-loop) for debugging purposes actually would have
*enabled* the code below, thus rendering the whole database useless.
Lucky me that I a) had backups b) set up a sandbox and c) actually saw
this before it was too late.
More information about the Python-list