|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
http://www.itworld.com/government/105031/will-wall-street-require-python
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
nemesis <nam### [at] gmailcom> wrote:
> http://www.itworld.com/government/105031/will-wall-street-require-python
Python must have the most idiotic block delimiter in the history of
programming languages: Whitespace indentation.
Why is it idiotic? Because whitespace is the one thing which gets most
easily and regularly lost in communication.
For example, someone might ask some question about Python in a forum or
blog post, and then someone might answer it with some Python code... and
the blog/forum software removes whitespaces from the beginning of lines,
completely changing the meaning of the program and making it inoperable.
There are also many other situations where whitespaces at the beginning
of lines might not be preserved (or might be changed somehow).
Also autoindentation of Python code is a physical impossibility.
The person who thought that it's a good idea to have indentation as
block delimiters should be shot.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> The person who thought that it's a good idea to have indentation as
> block delimiters should be shot.
I'll go find out which member of the Haskell committee decided to do this...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp escreveu:
> For example, someone might ask some question about Python in a forum or
> blog post, and then someone might answer it with some Python code... and
> *the blog/forum software removes whitespaces* from the beginning of lines,
> completely changing the meaning of the program and making it inoperable.
well, at least you recognize it's not Python's fault. ;)
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 04/20/10 03:52, Warp wrote:
> Why is it idiotic? Because whitespace is the one thing which gets most
> easily and regularly lost in communication.
>
> For example, someone might ask some question about Python in a forum or
> blog post, and then someone might answer it with some Python code... and
> the blog/forum software removes whitespaces from the beginning of lines,
> completely changing the meaning of the program and making it inoperable.
> There are also many other situations where whitespaces at the beginning
> of lines might not be preserved (or might be changed somehow).
You know, for all the complaints people have about Python's whitespace,
not once in all the years of coding Python has it been an issue for me.
Well, OK - occasionally had issues with people mixing tabs with spaces,
but then I learned to use a proper editor.<G>
Know how often I've had issues compiling because of a missing brace or
semicolon? Orders of magnitude more frequently than whitespace issues in
Python.
Once I had spent just a short amount of time in the Python world, I
really hated semicolons in whatever other language I was coding in. A
royal pain to have to enter a mostly pointless character after each
statement.
Most online forums have a [code] tag or something similar to ensure
nothing gets formatted. Otherwise, use a pasting service.
> Also autoindentation of Python code is a physical impossibility.
Why would this be a concern?
> The person who thought that it's a good idea to have indentation as
> block delimiters should be shot.
Shoot me while you're at it, too ;-)
Python's the only whitespace sensitive language I've dealt with where
it wasn't an issue.
--
Growing old is mandatory; growing up is optional!!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 04/20/10 04:15, nemesis wrote:
> Warp escreveu:
>> For example, someone might ask some question about Python in a forum or
>> blog post, and then someone might answer it with some Python code... and
>> *the blog/forum software removes whitespaces* from the beginning of
>> lines,
>> completely changing the meaning of the program and making it inoperable.
>
> well, at least you recognize it's not Python's fault. ;)
POTD.
--
Growing old is mandatory; growing up is optional!!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Neeum Zawan <m.n### [at] ieeeorg> wrote:
> Well, OK - occasionally had issues with people mixing tabs with spaces,
> but then I learned to use a proper editor.<G>
How does the Python interpreter/compiler even work with different types of
whitespace? If, for example, one line as 4 spaces at the beginning and the
next line has one tab character (which many editors will show as wide as
8 spaces, and in fact some editors will convert groups of 8 spaces into
tabs), how does the interpreter interpret that? And what happens if you
change the tab width in your editor settings?
I bet it can become pretty confusing when the interpreter is giving you
error messages or, much worse, it will parse ok but run complately wrongly,
even though it *looks* to be ok.
Relying on the use of whitespace for actual syntax is idiotic (with the
exception of separating tokens with at least one whitespace character,
while not being important how many).
> Know how often I've had issues compiling because of a missing brace or
> semicolon? Orders of magnitude more frequently than whitespace issues in
> Python.
I'm not concerned about typos. I'm concerned about whitespaces being lost
in transfer and different types of whitespace (spaces, different types of
tab characters..) being interpreted differently by different programs (the
text editor might be showing you something completely different than what
the Python interpreter is seeing).
Whitespace at the beginning of lines should be purely aesthetical, not
integral part of the syntax.
> Once I had spent just a short amount of time in the Python world, I
> really hated semicolons in whatever other language I was coding in. A
> royal pain to have to enter a mostly pointless character after each
> statement.
You seem to assume that statements never get longer than a certain length,
so that they will all nicely fit in one line. Sometimes it's useful to be
able to split statements into several lines.
> Most online forums have a [code] tag or something similar to ensure
> nothing gets formatted.
Except that many don't.
> Otherwise, use a pasting service.
Why should I have to use such things just because the language has a
braindead idea of using whitespace as syntax?
> > Also autoindentation of Python code is a physical impossibility.
> Why would this be a concern?
Because when your editor can autoindent your code, it makes programming
enormously easier (similarly to how syntax highlighting does).
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
discussion : 4bce01c9$1@news.povray.org...
> On 04/20/10 03:52, Warp wrote:
> Know how often I've had issues compiling because of a missing brace or
> semicolon? Orders of magnitude more frequently than whitespace issues in
> Python.
Same experience here. I guess that's because it's easier to miss a semicolon
or a brace in PHP than a whitespace in Python. I had to program in Python
for a few days last year. At first I had the same WTF reaction as Warp about
indentation but I found it much less error-prone in that respect than PHP. I
like PHP, but its unability to cope with missing stuff is a time sink, as it
outputs anything from a blank page to hebrew (unexpected
T_PAAMAYIM_NEKUDOTAYIM).
G.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> Also autoindentation of Python code is a physical impossibility.
No it's not. Replacing indentation in python once the dedents have been
lost is problematic. But that's like complaining if you delete all the
closing braces in C then you can't figure out where to put them back.
But making all the indents a consistent amount? Pretty easy.
--
Darren New, San Diego CA, USA (PST)
Linux: Now bringing the quality and usability of
open source desktop apps to your personal electronics.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Gilles Tran escreveu:
> I like PHP, but its unability to cope with
> missing stuff is a time sink, as it outputs anything from a blank page
> to hebrew (unexpected T_PAAMAYIM_NEKUDOTAYIM).
LOL
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |