Bug or intended behavior? (Posting On Python-List Prohibited)

Steve D'Aprano steve+python at pearwood.info
Fri Jun 9 07:32:03 EDT 2017


On Fri, 9 Jun 2017 02:23 pm, Lawrence D’Oliveiro wrote:

> The indentation itself doesn’t provide enough grouping, cf
> <http://ldo17.tumblr.com/post/155087402702/fixing-pythons-greatest-mistake>.


Your argument is:

    "Now, what happens if these pieces of code get posted online 
    somewhere, say in a discussion forum which makes it hard, or 
    even impossible to keep the correct formatting?"


"Doctor, it hurts when I stab myself in the eye with this pointy stick."

"Then stop doing that."

If your forum strips leading whitespace, the forum software is broken and should
be avoided if possible. If not, don't blame Python for your decision to use
broken tools.



You might as well argue that C's "greatest mistake" is to use braces for
grouping code blocks instead of BEGIN/END like Pascal, because there exists
broken software that strips { and } characters from your text.

Why would they do that? Simple: { and } don't exist in the original 1963 version
of the ASCII standard. For many years, very few computers supported braces.
That's why Pascal had *two* delimiters for comments:

    { comment }

    (* comment *)

It wasn't until 1967, four years after the initial ASCII standard was published,
that braces were added to the language. So any program which stripped
out "unassigned" characters from your source code would remove braces.

If we came across such a program, would we:

- argue that C and other brace languages are to blame?

- or that the *program*, not the language, is broken?




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list