Warby wrote:
...and I forgot to mention that the output of grep and diff is far more
understandable in the absence of block comments!
Which is why people do this /anyway/. (Kind of makes block comments
pointless, doesn't it?
/* This is a
* really
* really
* long
* block comment */
--
In article [EMAIL PROTECTED],
Jonathan Gardner [EMAIL PROTECTED] wrote:
Warby wrote:
...and I forgot to mention that the output of grep and diff is far more
understandable in the absence of block comments!
Which is why people do this /anyway/. (Kind of makes block comments
pointless,
On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote:
On 9 Mar 2006 07:21:00 -0800
msoulier [EMAIL PROTECTED] wrote:
(and if you don't, you can quickly comment out regions
by putting them inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
Not
On Sat, 11 Mar 2006 10:23:56 +1100
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote:
On 9 Mar 2006 07:21:00 -0800
msoulier [EMAIL PROTECTED] wrote:
(and if you don't, you can quickly comment out
regions by putting them inside a
Terry Hancock wrote:
I'm thinking this might be a use-case for the new support for
doctests in a separate file.
Having doctests in their own file is (IMHO) a majorly under appreciated
feature of doctest. The ability to do either nice user (as in
developer) docs with known good examples or
(and if you don't, you can quickly comment out regions by putting them
inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
Still, it's simple enough in an editor like Vim or Emacs to highlight a
region, and define a macro to add/remove #s. Any Python IDE
msoulier [EMAIL PROTECTED] wrote:
(and if you don't, you can quickly comment out regions by putting them
inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
I can't imagine a realistic scenario where the amount of memory wasted
by triple-quoting out code
msoulier wrote:
(and if you don't, you can quickly comment out regions by putting them
inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
Doesn't seem so:
def f():
... docstring
... another string
... a = 42
... yet another string
On 9 Mar 2006 07:21:00 -0800
msoulier [EMAIL PROTECTED] wrote:
(and if you don't, you can quickly comment out regions
by putting them inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
Not really. Unless it is the first string in the block
(class,
I'm still tyring to figure out what Pythonic means, and I have a
feeling the answer to my question may fall into that category. Are block
comments somehow unpythonic?
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
I'm still tyring to figure out what Pythonic means, and I have a
feeling the answer to my question may fall into that category. Are block
comments somehow unpythonic?
only in the sense that python don't have them.
but they're pretty pointless, if you have a modern editor.
Fredrik Lundh [EMAIL PROTECTED] wrote:
you can quickly comment out regions by putting them
inside a triple-quoted string.)
Except that triple-quotes don't nest.
I do agree, however, with the idea that any decent editor should be
able to comment out a block of code faster than I can type this
Roy Smith wrote:
you can quickly comment out regions by putting them
inside a triple-quoted string.)
Except that triple-quotes don't nest.
''' ...except when they do '''
/F
--
http://mail.python.org/mailman/listinfo/python-list
It's clear that if you have a modern editor, block comments are
unnecessary because it is trivial to add a # to the start of each line
of a block, but that doesn't really answer your question. It explains
why you might not always need block comments but doesn't explain why
you shouldn't use them
...and I forgot to mention that the output of grep and diff is far more
understandable in the absence of block comments!
--
http://mail.python.org/mailman/listinfo/python-list
Warby wrote:
The danger with block comments is that there is no way to tell that the
code you're looking at has been commented out unless you can see the
start or end of the comment block. If you have a modern editor, it
probably changes the color of all commented out code to eliminate
Warby [EMAIL PROTECTED] wrote:
Eliminating block comments eliminates uncertainty. :)
An even better way to eliminate uncertainty is to eliminate the code.
Commenting out is fine for a quick test during development. Once the
code is committed, the dead code should be eliminated completely.
--
On Wednesday 08 March 2006 12:42 pm, Warby wrote:
The danger with block comments is that there is no way to tell that the
code you're looking at has been commented out unless you can see the
start or end of the comment block. If you have a modern editor, it
probably changes the color of all
I have found that some editors colourize text based on parsing a
section of text around what is visible. Long, multi-line comments or
strings might not then get colored correctly.
Personally, I do use block comments in other languages but maybe they
should not exist in finished code for reasons
19 matches
Mail list logo