Guido sees the light: PEP 8 updated

Marko Rauhamaa marko at pacujo.net
Tue Apr 19 04:09:47 EDT 2016


Pete Forman <petef4+usenet at gmail.com>:

> I like that Nick separates out the concept of alignment with implicit
> semantics from the n spaces v tabs arguments. My question asks why
> monospace is used for the text.

Because the so-called "plain text" is the age-old lowest common
denominator for formal syntax. Python is especially picky about
alignment, but the same de-facto assumption is critical pretty much in
any programming language from Pascal to Go.

Old computer science textbooks presenting algorithms in Algol, Pascal
or, say, process algebra, did use varying-width fonts but they were
typeset manually.

You *could* liberate programming languages from the monospace
stranglehold but then you couldn't effectively use "cat", "vi" or
"firefox" to display Python programs. You probably would need to wrap
the source code in some richer markup like XML and support it specially
in the editors.

Such enrichment would offer advantages. For example, the visual layout
wouldn't necessarily have to be rigid. No more line-length wars (no
lines would ever need to be "continued"). No more TAB wars. Comments
could be displayed as floating bubbles, or maybe you would have to
scratch the screen to see the comment text.

Why, you could even decide on local language variations. How about
braces to delineate blocks in Python? How about translating the keywords
into Japanese? How about setting the Python code right-to-left with
Hebrew keywords?

Now, descending back on earth, I don't believe the advantages of rich
source code will outweigh those of plain text in the foreseeable future.


Marko



More information about the Python-list mailing list