by vorpalhex · 4y ago · 0 comments
The direct text entry programmer has to:
1. Decide what they want to happen next
2. Figure out the syntax to make that happen
3. Write out the syntax
Our visual programmer:
1. Decide what they want to happen next
2. Figure out the syntax (now "big green two pronged if block" instead of "if")
3. Look over the palette and visually identify the block (expensive! non-facial discrimination is tiring)
4. Drag the block from the palette to the code section (weird UI interaction, also requires both fine + gross movement, also expensive)
Notice that our "visual" programmer still has to execute all the same non-visual steps! We haven't made the actual work visual, we just made the UI really annoying and added a discrimination task to it - which is tiring even for our visual learner.
Text _is_ visual, but it's visually expensive to consume. Brightly colored complex little blocks are also.. well basically just as visually expensive.
We didn't make programming visual. We didn't make the skill threshold lower or easier or even _different_. We just added more work.
I know for certain that this is how I see writing programs in pure text, to the point that I stopped programming in traditional languages; my brain is too high-level oriented to remember all the pesky little details that APIs and formal syntax require; give me high-level programming blocks that you just invoke and place with a few gestures any time.
Unfortunately there are very few general-purpose visual languages, so my options at building automated systems are limited; although fortunately this is starting to change, and a new breed of powerful no-code and low-code tools is appearing that shows promise, so I'll be able to build complex systems again by using high-level concepts as building blocks, without being slowed down by bloody trivial syntax errors.
This is not surprising, because "general purpose" tools have general, highly-composable, extensible syntax. Endowing, e.g. condition operators with their own block shape makes sense when all you have is a simple tool like Scratch where they just "snap" inside if-then blocks, but not so much when "boolean" is simply one of many interchangeable types that might, e.g. be assigned to a variable. Then a condition operator is simply some expression-like element that just happens to return a boolean. Similar things happen with other program elements, like text strings, numbers etc. Custom types start to be needed, and then you need to add whatever the equivalent of a DATA DIVISION is in your Scratch-alike.
At the extreme of generalization, you find things like dependently typed languages where even "values" and "types" are no longer separated by rigid syntax, but are the same kind of program element.
And don't tell me that textual programmers don't realize the benefit of secondary notation and visually-conveyed details. We love when our IDEs full with syntax highlighting for different types of operators, global structure mini-maps and intellisense auto-complete tooltips. All these are visual tools that improve the flow of building a text-based program.
Take a moment if you haven't and boot it up. I think there are web versions available now. Give it a go. Build a (simple) program.
There's a reason it keeps not really taking off.
I'm not saying text entry is free. I'm saying that the palette concept is more expensive - even for visual learners. Obviously languages (block based or text) can be easier or harder, eg python is less fussy than assembly.
What visual/block based languages do you use currently?
I've seen scratch used in dozens of coding sessions for kids, and know it used used in hundreds of schools in the UK.
Yes, people only use scratch for a while, almost no-one is writing huge programs in Scratch, but that's not what it is for.
I remember someone building a whole environment for making Slack look professional, by providing a text syntax that could nevertheless be programmed like Slack by adding and connecting typed blocks in the text structure (though I can't recall its name).
I was referring to your defense of textual programming as inherently superior, which I don't see as justified. Classical languages have a refinement over decades that visual languages lack, but I think it is possible, and I think we are getting to a point where building such languages is starting to become viable.
> I'm not saying text entry is free. I'm saying that the palette concept is more expensive - even for visual learners
This is simply not true. Recognition is easier than recall, even for textual learners; so even if toolbars require more steps, those are way easier steps. Even if you're talking about expensive in time and not actual effort, physically entering code is the task that less actual time takes of programming: thinking what code you need to include takes much more time, so anything that reduces that time will accelerate development. Programmers usually are not aware of this fact because they are distracted by all the thinking, but the actual input method is usually not that relevant except for people with disabilities. (Btw visual vs word learners is largely a myth; the best style is usually to the task you're doing, and we are all able to do both styles. When I say I have a preferred style, I do find visual tasks easier than those requiring word recall skills).
Also, nothing prevents visual languages from incorporating fast introduction tools other than palettes, like keyboard accelerators and contextual search - i.e. you type the name of a component and it appears at the cursor point; this would make them work with identical interactions as pure text programs. (BTW, I consider intellisense-autocomplete to be a visual tool; it favors recognition over recall by showing you the list of available options).
What I consider a programming language is somewhat different from what think of as visual languages (which are primarly the flow-based block graphs; they have their place, but are too highly oriented to bulk data processing). For me, the ultimate visual language is the spreadsheet - a functional reactive environment where the user can freely position information and transformations in more than one dimension, and manually decorate them with as many cues, reminder text and color codes as needed.
Some new development environments are growing a modern style, highly evolved with respect to the classic IDE, which is still based on the batch model of the mainframes in the 60s:
* Jupyter-like notebooks bring some of the spreadsheet benefits to classic languages;
* relational models that show data together with structure, like Airtable, is an example of these breed of visual tools for building data-transforming automations;
* wikis work as visual storage that makes it easier to structure and organize hierarchical content;
and so on. Modern development environments will start incorporating all these models, relying less in pure abstraction and running the program in your head as requirements to build programs.
I agree with this point
> was referring to your defense of textual programming as inherently superior,
This is inaccurate of my views. It's not that "visual programming is bad" it's that everything we call visual programming is not actually visual! Scratch is not visual. It's just text programming with more steps.
> For me, the ultimate visual language is the spreadsheet - a functional reactive environment where the user can freely position information and transformations in more than one dimension, and manually decorate
I'm sympathetic to the concerns here, eg users needing to work in multiple dimensions. I still don't think this is a visual language, but it is maybe more visual than traditional visual languages. A spreadsheet is something like a visual layout on top of a program.
> relying less in pure abstraction and running the program in your head as requirements
Even with a true visual language I don't think the need for a mental model can be removed.