On 2010-02-25, Michael Rudolf <spamfres...@ch3ka.de> wrote: > Am 25.02.2010 16:07, schrieb Grant Edwards: >> On 2010-02-25, Paul Rudin<paul.nos...@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 only time you'll see that in my code is if you're watching over my shoulder as I troublshoot something. > 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. Nobody in their right mind _leaves_ "commented out" code like that (or other commenting mechanisms) in a program after they're done with whatever little experiment they were performing. I know people who will re-write a block of code and leave the old code there, but comment it out, along with the date and their name, and other such nonsense. I hate that. Keeping track of what _used_ to be there and who changed what when is the job of the version control system. Trying to keep the edit-history of a file in-line as comments just makes the code hard to read and maintain. > This is almost as bad as "commenting out" (parts of) a for > loop by adding a continue. IMO, any sort of "commented out" code left in a program is a big mistake. If the code is soething that does need to stay for optional use, then it needs to be properly integrated along with logic to control when it's used. -- Grant Edwards grante Yow! Four thousand at different MAGNATES, MOGULS visi.com & NABOBS are romping in my gothic solarium!! -- http://mail.python.org/mailman/listinfo/python-list