POV-Ray : Newsgroups : povray.off-topic : All bow to the mighty Python : Re: All bow to the mighty Python Server Time
4 Sep 2024 07:15:03 EDT (-0400)
  Re: All bow to the mighty Python  
From: Warp
Date: 20 Apr 2010 16:31:12
Message: <4bce0f10@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.