Single Pound # comments versus Double Pound ## comments

Jeff Epler jepler at unpythonic.net
Fri Oct 4 22:29:11 EDT 2002


On Fri, Oct 04, 2002 at 05:14:57PM -0700, Chad Netzer wrote:
> And then use the "if 0:" idiom.  Or auto-insert of comments.
> 
> Ah, but that is all work... Yes.  So, do the benfits outweigh the costs. 
> Hmmmm...  Well, I personally am not a big fan of using comments to disable 
> code; I guess I've seen WAY to much abuse of it at work and elsewhere.  And 
> my editor is more than capable, so perhaps others can weigh in on what it 
> would buy them.

I think this syndrome is common where there's either no revision control or
some programmers aren't familiar with the power of the systems.  The large
project I work on has had a heavily customized RCS setup for 3 years now,
but one old-time programmer still surrounds his changes with
    #if 1 /* so and so, this day, 2002 */
    .... new code ...
    #else
    .... old code ...
    #endif
.. and another saves copies of her changes with strange names like
'somefile.c-----this-date----bugreportnumber----changed-something' in case
she "needs to undo the changes".

Armed with rcs and ediff, this is largely unnecessary, since you can revert
the file to past versions, find commentary on each change, easily find
differences between the release & development trees, etc.

Hey, can I submit a patch to Python so that I can run
    python -rREV somescript.py
and run the named version of the script?  This would be great---by using a
symbolic tag, I could run any past version of the script.  Maybe by using
comma-separated tags I could specify a series of them to be tried for each
file until one passed:
    python -rmyproject_1_0,release22-maint myscript.py
this will use files from version 1.0 of my software and from the
release22-maint branch of Python.

Okay, okay, I'm just joking.  God, it's not like I was going to tell one of
those lame PSA jo





More information about the Python-list mailing list