Guido sees the light: PEP 8 updated

Steven D'Aprano steve at pearwood.info
Tue Apr 19 21:38:42 EDT 2016


On Wed, 20 Apr 2016 04:54 am, Random832 wrote:

> You could, for example, design a programming language that uses XML
> markup to associate comments with specific positions in the code and the
> editor displays them in little callout boxes when you hover over them
> with the mouse. That's not done because of the notion that code has to
> be plain text.

No, it's not done because the user interface of such a language would be
absolute bollocks.


The reason programmers use text for communicating with (1) other programmers
and (2) the computer is that text is still, and probably always will be, so
much better than any other media *for the purpose of programming* as to
make it no contest.

I'm sure that interpretive dance has its uses, but can you imagine the
computer infrastructure needed to make that practical for programming?

More seriously, there have been attempts to come up with "point and click"
interfaces for programming. The idea makes a sort of sense, if you think of
programming as a flow-chart (does anyone still use them?), but outside of a
handful of specialist areas, they have been a total, utter dead-end.

So-called "visual programming environments" (think: Visual Basic) are
well-suited to laying out the interface of GUI applications. They might
even be useful for extremely limited mini-languages like regexes. I'm told
that there are still people who think that UML diagrams are a good idea.
They're probably good for dataflow programming. But ultimately, to be
productive with one, you still need text.

As for "visual programming languages" (languages with an inherent visual
form which lacks any simple or obvious text equivalent), they've been a
dead-end. Even languages like Scratch cannot do without text. Look at
the "Hello World" program here:

https://en.wikipedia.org/wiki/File:Scratch_Hello_World.png

The graphical elements are pure presentation, to make it more palatable to
children and beginners.

Don't think that I'm opposed to such visual presentations. Look at the
sample code shown at the top of the page here:

https://scratch.mit.edu/

It kinda looks like Hypertalk syntax, which some of you may remember I'm
exceedingly fond of. There's no reason why a GUI editor couldn't display
Python code using such "building block" structure. E.g. indented blocks
could use colour and shape cues to reinforce the structure of the code,
just as Scratch does.

And if you want to see another reason why text rocks as the core for
programming languages?


"Oh no! We're having trouble displaying this Scratch project.

If you are on a mobile phone or tablet, try visiting this project on a
computer.

If you're on a computer, your Flash player might be disabled, missing, or
out of date."

Yeah, thanks guys. Really helpful.



-- 
Steven




More information about the Python-list mailing list