Guido sees the light: PEP 8 updated

Chris Angelico rosuav at gmail.com
Tue Apr 19 22:21:50 EDT 2016


On Wed, Apr 20, 2016 at 11:38 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> 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.

Scratch itself is aimed at children, but there's a very similar
language (or maybe it's actually a Scratch derivative) used by the
Unreal Engine to animate sprites - the "blueprint" system. I've seen
it used by someone who doesn't consider herself a programmer in any
way, yet she has a sufficiently logical mind to do the same kind of
work as programming requires. Effectively, flow control has been
turned into a two-dimensional graph, with nodes pointing to other
nodes, but each node is still described primarily with text (using
colour to add instant recognition).

I think there's a lot of value in depicting flow control graphically.
For anyone who's accustomed to working visually, seeing nice little
tagged blocks of "stuff", linked by little lines to show how you get
from one to another, is way easier to handle than a page of "while"
and "if" and "else" statements. But even there, each piece of flow
control is *defined* in text - there's a short message saying what the
condition is, and then two or more pieces of text defining the
potential results of the condition, from which you can link to
destinations.

https://www.twitch.tv/ellalune/v/59455498 - starts at about the 41
minute mark. Notably, around the 00:42:30 point, I say that this is
code, and she says that, well, it sort of is code, but it doesn't
*feel* like code.

Probably the least text-y form of coding that I've ever seen is turtle
graphics, where you depict something using (usually) two dimensional
movement and rotation. But even there, it's normal to use text to
define all the actual actions. Take this, for example:

https://studio.code.org/s/frozen/reset

A nice tutorial, a theme that'll appeal to a lot of people (including
young children), and primarily point-and-click (or drag) to move
components around - but you can *read* the meaning of each component,
in *text*. Once again, it uses a visual representation of flow control
to bury some of the complexity, but the basic actions (move, turn,
etc) are text - and if you want to "capture" a series of actions to
reuse, the way to do that is to give it a name, because names and
words are how people think.

ChrisA



More information about the Python-list mailing list