Case Sensitive, Multiline Comments

R

Roy Smith

I do too. As you've found, the only reason is because it is, and it is
too late to change (it was even too late back in 1999 when it was
considered by Guido). I guess the most popular case-insensitive
language nowadays is visual basic (and VB.NET).


Again, just because there aren't and never were. There is no technical
reason (like for example a parsing conflict) why they wouldn't work in
python. That's why most python editors have added a comment section
command that prepends # to consecutive lines for you.

If it really bothers you that there's no multi-line comments, you could
always use triple-quoted strings.

I actually don't like multi-line comments. They're really just syntactic
sugar, and when abused, they can make code very difficult to understand.
Just wait until the day you're trying to figure out why some C++ function
is behaving the way it is and you don't notice that a 50-line stretch of
code is commented out with /* at the top and */ at the bottom.
 
A

Arthur

Because it comes from a language background of case sensitive
languages (C, shell, etc.). But read what the BDFL has to say about
it: <URL:
http://mail.python.org/pipermail/python-list/2001-July/054788.html >

As Guido's statement on his position on case sensitivity/insensitivity
cited above was in response to a post/provocation of mine, its gives
me, and I shall indulge myself in, an opportunity to partake of a
favorite pasttime - venting,

I will make it short:

It gauls the hell out of me that that the Python community mass "head"
was in such a strange place at that moment that I had to take the pose
of maniacal extremist to have a sensible converstaion.

Or that's the history I am writing, in any case.

Art
 
L

Leif K-Brooks

Roy said:
Just wait until the day you're trying to figure out why some C++ function
is behaving the way it is and you don't notice that a 50-line stretch of
code is commented out with /* at the top and */ at the bottom.

The same thing's happened to me in Python when I accidentally included a
function's code in its docstring (don't ask me how I managed to do that
-- I don't know). But my editor's syntax highlighting helped me to find
the error very quickly.
 
D

D H

Roy said:
I do too. As you've found, the only reason is because it is, and it is
too late to change (it was even too late back in 1999 when it was
considered by Guido). I guess the most popular case-insensitive
language nowadays is visual basic (and VB.NET).



Again, just because there aren't and never were. There is no technical
reason (like for example a parsing conflict) why they wouldn't work in
python. That's why most python editors have added a comment section
command that prepends # to consecutive lines for you.


If it really bothers you that there's no multi-line comments, you could
always use triple-quoted strings.[/QUOTE]

Where did I say that?
I actually don't like multi-line comments. They're really just syntactic
sugar, and when abused, they can make code very difficult to understand.
Just wait until the day you're trying to figure out why some C++ function
is behaving the way it is and you don't notice that a 50-line stretch of
code is commented out with /* at the top and */ at the bottom.

Same with triple quotes, btw.
 
T

Terry Reedy

D H said:
I do too.

I don't.
As you've found, the only reason is because it is,

False. As someone else already pointed out in this thread, and as some
said years ago when Guido brought up the subject, standard math notation
*is* case sensitive and some people like Python because they can directly
translate math expressions into Python expressions.

I am annoyed by the disinformation and slander ('anti-newbie') repeated
indefinitely by some case-folding advocates. Difference annoyances for
different folks, I guess.

Terry J. Reedy
 
M

Magnus Lycka

Terry said:
Difference annoyances for different folks, I guess.

IN MY EXPERIENCE, MANY PEOPLE ON THE INTERNET ARE
ANNOYED BY PEOPLE WHO DON'T USE CASE THE WAY THEY
ARE EXPECTED. IT ALSO SEEMS TO ME THAT LOWER CASE
TEXT IS OFTEN MORE EASY TO READ, AND ALSO THAT IT
IS EASIER TO SCAN TEXTS IF CASE IS CONSISTENT. WE
DO AFTER ALL SEE IMAGES ON THE SCREEN. EVEN IF WE
RELATE "IF" WITH "if", THEY DON'T LOOK THE SAME.
MY SON POINTED AT THE WORD "TOYOTA" IN A MAGAZINE
AND EXCLAIMED "TOTOTA" WHEN HE WAS ONLY THREE. HE
WAS CLEARLY TOO YOUNG TO READ, BUT HE RECOGNIZED
THE IMAGE OF THE LOGO HE HAD SEEN ON OLD TOYOTAS.
IN GENERAL, PYTHON "TRIES" TO FORCE A PARTICULAR
STYLE OF CODING ON PROGRAMMERS. WE HAVE TO INDENT
IN A PARTICULAR WAY. THE STYLE OF PROGRAMMING HAS
BEEN CODIFIED IN PEP 008, AND COWBOY PROGRAMMING
ISN'T REALLY APPRECIATED. YOU ARE NOT "SUPPOSED"
TO PROGRAM PYTHON "YOUR WAY". YOU ARE SUPPOSED TO
PROGRAM THE RIGHT WAY. IF YOU DON'T LIKE THAT, IT
IS PROBABLY BETTER TO USE ANOTHER LANGUAGE. PERL
IS MORE OF A COWBOY LANUGAGE. THE FUNNY THING IS
THAT EVEN PERL IS CASE SENSITIVE! EXPLAIN THAT!!!
IMO IT'S A STRENGTH OF PYTHON THAT PYTHON CODE IS
ALWAYS CONSISTENT IN CASE. IT IS PROBABLY A MINOR
FEATURE COMPARED TO THE BLOCK STRUCTURES ETC, BUT
I THINK IT ADDS TO THE EASE OF READING CODE WHICH
HAS BEEN WRITTEN BY OTHERS. I DO ALSO DISLIKE THE
ALTERNATIVES. NEITHER CODE WITH INCONSISTENT USE
OF CASE NOR THE STUPID "CASE CORRECTING" FEATURES
IN E.G. THE VISUAL BASIC IDE SEEMS TO BE ANYTHING
TO STRIVE FOR. IF YOU THOUGHT IT WAS ANNOYING TO
READ THIS, THEN YOU CAN AT LEAST APPRECIATE THAT
PYTHON CODE NEVER LOOKS LIKE SUCH A COMPACT BLOB!

Who am I kidding with this? Everybody knows that
case doesn't matter, right? The text below isn't
a bit easier to read than the text above, right?

In my experience, many people on the internet are
annoyed by people who don't use case the way they
are expected. It also seems to me that lower case
text is often more easy to read, and also that it
is easier to scan texts if case is consistent. We
do after all see images on the screen. Even if we
relate "IF" with "if", they don't look the same.
My son pointed at the word "TOYOTA" in a magazine
and exclaimed "Totota" when he was only three. He
was clearly too young to read, but he recognized
the image of the logo he had seen on old toyotas.
In general, Python "tries" to force a particular
style of coding on programmers. We have to indent
in a particular way. The style of programming has
been codified in PEP 008, and cowboy programming
isn't really appreciated. You are not "supposed"
to program Python "your way". You are supposed to
program the right way. If you don't like that, it
is probably better to use another language. Perl
is more of a cowboy lanugage. The funny thing is
that even Perl is case sensitive! Explain that!!!
IMO it's a strength of Python that Python code is
always consistent in case. It is probably a minor
feature compared to the block structures etc, but
I think it adds to the ease of reading code which
has been written by others. I do also dislike the
alternatives. Neither code with inconsistent use
of case nor the stupid "case correcting" features
in e.g. the Visual Basic IDE seems to be anything
to strive for. If you thought it was annoying to
read this, then you can at least appreciate that
Python code never looks like such a compact blob!

oF cOuRsE, wE sHoUlDn'T aSsUmE tHaT pEoPlE wIlL
aBuSe ThE fReEdOm ThEy GeT, bUt I'm RaThEr SaFe
ThAn SoRrY! ;^) I'm ReAlLy hApPy ThAt I'lL nEvEr
HaVe To SeE aLl-CaPs PyThOn PrOgRaMs!
 
B

Benji York

What I want to know is how Mangus wrote an entire message fully
justified. I looked for extra spaces and other cheats but only
found a couple of superfluous exclamation marks. Well done! He
must be a justification wizard. I wish I could do that too. :)
 
R

Roel Schroeven

Benji said:
What I want to know is how Mangus wrote an entire message fully
justified. I looked for extra spaces and other cheats but only
found a couple of superfluous exclamation marks. Well done! He
must be a justification wizard. I wish I could do that too. :)

I hadn't even seen it at first, since I use a proportional font for
reading my mail.

You haven't looked very well though: there are actually quite a lot of
extra spaces. Still, it's nicely done indeed.
 
A

Arthur

I don't.


False. As someone else already pointed out in this thread, and as some
said years ago when Guido brought up the subject, standard math notation
*is* case sensitive and some people like Python because they can directly
translate math expressions into Python expressions.

False.

In the sense that it is the way it is only because Guido kept it the
way it is, but he did so without acknowledging that your argument or
anyone else's argument was in the least bit pursuasive to him.
I am annoyed by the disinformation and slander ('anti-newbie') repeated
indefinitely by some case-folding advocates. Difference annoyances for
different folks, I guess.

I am annoyed that Guido skated while those of us vocally annoyed that
Guido could be influenced into this substanceless "newbie" issue, and
influence so many others to contemplate it with such solemnity - did
not skate as well.

Art
 
B

Benji York

Roel said:
> You haven't looked very well though: there are actually quite a lot
> of extra spaces. Still, it's nicely done indeed.

Hmm. I only saw doubled spaces after commas and periods. That's
fairly standard practice, for the periods at least. I don't know
if people regularly put two spaces after commas though. I know I
don't. I did spot a couple of extra quotation marks, but I guess
I can give him those. :)
 
P

Peter Hansen

Benji said:
Hmm. I only saw doubled spaces after commas and periods. That's
fairly standard practice, for the periods at least. I don't know
if people regularly put two spaces after commas though. I know I
don't. I did spot a couple of extra quotation marks, but I guess
I can give him those. :)

Doubled spaces after commas are definitely not standard usage.

Doubled spaces after periods are fairly common (a holdover from
fixed-pitch typewriters, as I recall, where the period itself takes up a
full character width and so needs doubled space after it to make the
sentence breaks more noticeable).

Inconsistent use of doubled spaces after periods, however, is a sign of
a smart justification algorithm. <wink>

-Peter
 
M

Magnus Lyck?

You haven't looked very well though: there are actually quite a lot
Doubled spaces after commas are definitely not standard usage.

I guess the fact that *all* comments on my post only referred
to my formatting, tell us something about how distracted we can
get by purely "typographic" aspects of text. I think that might
strengthen my case. Text that visually looks different than we
are used to, distracts us from the content.

Another interpretation would be that the content of my previous
post was a bit thin, since I was to caught up with form... I guess
that *also* suggests that we should use standard Python formatting
and concentrate on content...

Of course, if you're used to typing If in other languages, Python
might initially feel annoying, just as C++ feels stupid when it
forces me to put a silly ; in the end of each line. On the other
hand, there are other things beyond syntactic details that differ
more between languages, and it's pretty easy to get used to Python.

I think the thing that bothered me most initially was the differnt
shape of the code, since there were no explicit block end markers
in Python.

I was really used to code looking like this:

xxxx
xxxx
xxx
xxxx
xxxx
xx
xxx
xxxx
xxx
xxx
xxxx
xx
xx

And now it looked:

xxxx
xxxx
xxx
xxxx
xxxx
xxx
xxxx
xxx
xxx
xxxx

It somehow felt very abrupt, and I missed the visual cues that
we were going back to a previous block level. After some time I
got used to it, and I very rarely hear anyone contest that code
written in Python usually is easier to read than code written
in other languages. The lack of block end markers, is one of
several Python features that promote clarity and a high signal/
noise ratio in the source code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top