by pavlov · 10y ago · 0 comments
I've always felt sad that this dichotomy is so strong in our industry. There are graphical tools for proles and then there are text-based tools for programmers, and never the two shall mix.
It didn't have to be this way. Smalltalk was an integrated graphical system for both programmers and users already 40 years ago. Something like the Smalltalk class browser with visual editing of live code would feel revolutionary even today compared to most of the systems we have.
But we're seemingly stuck with another '70s approach, that of Unix: streams of plain text, UIs based on undiscoverable and inconsistent command line argument arrays, all glued together with a spider's web of incredibly fragile string-replacement tools like shell scripts and templates.
And there are advantages to text-based UIs (scriptable, composable, copy-pastable) that I think would be hard to reproduce in graphical UIs.
There's initial BSD-style arguments. Almost always single-dash and single-letter. Not entirely consistent.
There's GNU-style arguments. While (usually) consistent with equivalent BSD-style, there are long args, given by double-dash and multi-character arguments.
Then there are the utilities which eschew either. Single-dash multi-character args, random-character args, alternative delimiters.
(dd is a special case: it's derived from the mainframe JCL data-dump command, and syntax.)
Recognising these ontologies often helps.
The fact that CLIs get incorporated into scripts gives really fucking strong incentive to upstream devs not to randomly change shit. It breaks fucking everything, and often will cause users (usually admins or coders themselves) to flee tools which practice this.
Is's one thing to keep a consistant UI within your own application, but doing it across a hundred different ones is something I have still to see, in the graphical world as well as the text based.
Cities, buildings, books, philosophy and theology all bear the marks of their time.
For me it becomes a modal guide: given XYZ attributes I can expecr MNO properties (usually).
As another commenter notes, GUIs have similar tendencies. And Web frameworks.
One applies to lowering the bar for novice users, the other is a force-multiplier for experienced users.
And CLIs are relatively cheap because calling main() and doing some stuff is just a few extra functions.
Graphical tools usually need to hook more deeply into the software to extract the data and transform it into interactive UI components.
Eclipse implemented their own java compiler they could instrument for syntax parsing so the IDE has total knowledge of the code for example.
Many CLI tools are also non-interactive. Adding that interactivity adds complexity.
> Graphical tools usually need to hook more deeply into the software
I don't even know what that means, exactly. You mean they need more dependencies?
> Many CLI tools are also non-interactive. Adding that interactivity adds complexity.
Most things worth doing are difficult.
Calling that a "solution"...
AppleEvents are a high level event framework, it lets you tell applications things like 'select the 5th word of the 2nd paragraph', or 'import all mp3s from /Volumes/USB'. AppleScript tries to allow you to use those exact phrases and creates an uncanny valley language.
Automator and other automating applications use AppleEvents to do their magic. Cocoa has AppleEvents built in for the basics, but support has been spotty beyond that so a lot of people are turning to the accessibility framework.
I stopped using Mac OS when OS X dropped Classic compatibility.
But you conflate the solution with the particular implementation.
It could be whatever else language instead of AppleScript, e.g. Python or Javascript -- it's the idea that matters.
What I, personally, prefer to do is construct libraries and simultaneously develop a collection of CLI tools to access them. Then build the GUI afterward, once I've already vetted and tested the underlying business logic.
The benefit of this is the GUI for most users. The CLI for power users. The library for the developers that want to build additional interfaces or plug it into their projects directly.
I already gave an example, but I can expand on that.
A CLI compiler only has to take its input and run it through the various compilation stages to the end or abort if something is invalid.
To do what eclipse does for code completion as you type on the other hand you have to to hook into the AST generator stage and the type inference engine given partial, invalid inputs, try to fix them up and then do searches on what other known pieces can be dropped into a particular place.
Which means your compiler can't just bail out at its earliest convenience. It needs public, not internal, APIs to massage state back into working condition so the next steps can then run until the IDE has gathered enough information.
Or take a memory profiler (with allocation callsite recording). The first step of interactivity is being able to turn it on and off at runtime. That means hot-swapping out some code, imagine replacing a malloc with a call-stack capturing one. It gets even more complex if you're using custom allocators.
And for the analysis part: In a simple CLI tool you might just run some graph analysis that takes 20 seconds on a multi-GB heap dump which then spits out the top 10 dominators and a class histogram and you'll hopefully know what to optimize. And you might want to diff those outputs (yay for text processing!) for test runs so you know how things change from build to build.
In a GUI you want interactivity, which means you can't just run those 20-second calculations every time the user navigates through some tree view. You need incremental algorithms, caching sub-results - but not too much otherwise the profiler itself will munge too much memory - etc. etc.
So you need APIs that go deeper into your graph logic than what you would think of public APIs needed for the CLI. And of course you need to build the whole GUI on top of that too.
> Most things worth doing are difficult.
The most important thing is to identify and get rid of all accidental complexity.
Complexity does not mean that it's worth doing because it's difficult.
I PREFER - strongly - text-based because graphical based means some obscure binary protocol/file format that bitrots into obscurity. You can always learn to do hardcore text manipulation. You can't necessarily reverse-engineer, say, a Word 1.0 document.
Text is the cockroach format.
I.e. ugly and hard to get rid of? ;).
The problem with Unix isn't text - it's unstructured text. Every utility needs to implement its own copy of ad-hoc, bug-ridden parsers to operate on the same data - and if you want to string some of those utilities together, you often end up writing ad-hoc parsers too.
The sad thing is that we knew how to work with structured text. Then the Unix came and ignored all that experience.
Which is?
A while back I was putting together a DB query tool for volunteer staff to use. I deliberately made it simple and as unambiguous as I could within the limits of "simple". For example, allowing a free form search of principle database fields, I set up a very basic regular expression syntax, just substring match, and optionally '*', '+', '|', and '.'.
This part of the interface is 3 text entry fields, with a nicely worded help message right next to the entries. In person, I showed the primary users how the interface worked and demoed the simplified regex.
Months later there are sometimes still questions like "how do I find somebody named 'John Q. Smith'?" ("Just enter 'smi' and pick the name off the list of names sent back.") I don't mind going over it again, especially for someone new, but I think it shows it may be harder than we anticipate to introduce "programming-like" methods to typical users.
A core idea of them has been that the things that make coding hard for business people are different from the things that make coding hard for programmers and I don't believe that at all. (If programmers can't stand to use it to do simple things, how do you expect business people to go anywhere with it?)
It's not that a GUI can't be helpful, it's that "GUI" isn't a synonym for helpful.
If there's a problem that can be solved by looking at a map (perhaps dataflow through components) then yes, it'd be great to present that visually.
The problem is that most of the people having this discussion know programming from movies like Hackers. They want a picture of an oil-tanker rolling over despite the fact that the code in question (theoretical code - never shown in the movie) wouldn't know what an oil tanker was, it'd simply react to one number changing by changing another. The meaning is all dependent on what platform it's installed on.
Closer to the domain my favorite example of malware is the ontology editor protoge. Every day I see freshers who are highly confused getting started with protoge who are then blown away with how easy it is to write an RDFS ontology in a few lines of Turtle with an ordinary text editor.
I am confident, having scoped many a project, that often the case is the stakeholder not quite knowing what they want. A good UI then is a good step forward to allowing the stakeholder to iterate on refining their interpretation of their own problem.
I am in the market for a decent BPM that doesn't want to charge crazy amounts and forcing us to buy support (I'm looking at you, Bonitasoft). Right now we're using Activiti it is awful. It also seems like the least bad of the FOSS offering.
Oh, and if you are genuinely interested in trying K2 before buying, I'll be they'd set up a VM for you to remote into. They did for me in '10.
Here's a screencast showing some basic functionality: https://youtu.be/As0WUtBV3NQ?t=66
There's a lot of things that I dislike about Eagle, but I definitely miss those things when I'm using other CAD packages.
Compare Autodesk Inventor. No command line, and it doesn't need one. All the new Autodesk tools (Fusion, etc.) are based on Inventor.
It's very hard to do a GUI for an elaborate 3D program, because you need to select multiple objects, talk to the GUI, and change the viewpoint, all within one operation. Yet it's been done successfully. Inventor doesn't even use hotkeys much; you can do almost everything with the mouse except enter numeric values.
Look at the Linux systemd / init debate. Despite the fact that sysvinit is clearly ancient, awful technology there are still people who have spend time learning it and don't want something better.
Another example: bash. Clearly an awful awful language/shell but it sticks around because too many people can't admit that the thing they know is rubbish.
If you ask people why they use bash, and why they don't like systemd, you get perfectly reasonable answers. (I'm not going to go into them here for obvious reasons.) You can't just dismiss these people as stick-in-the-muds.
You should try thinking about what a better bash would look like, it's not as simple as you make it to be. I think the best I've seen in this direction is rc and I think that's still not enough to compensate for the loss of ubiquity.
The stuff people come up when they try to "redesign the unix terminal" (usually some javascript contraption) is always extremely lacking.
* Image support (I can't remember where I saw this but it exists)
* Structured data piping (in Powershell)
* Machine-readable command-line arguments, which would enable...
* ...Proper autocomplete (like in IDEs)
* Real types (Bash is 'stringly typed')
* Sanity (e.g. look at how `[` is implemented in Bash; none of that)
* A better way to integrate with programs than running them on the command line (e.g. shell bindings).
That last one would be tricky and really requires moving away from the C ABI as the Lingua Franca of libraries. That is probably quite far away in the future unfortunately.
[1] http://acko.net/blog/on-termkit/
[2] https://www.reddit.com/r/programming/comments/137kd9/18_mont...
It's kind of a "cheat," but I've been really happy playing with xonsh (which is essentially bash + ipython)[0]. Bash with better control flow and types... it's suddenly not so maddening anymore.
>>> print("my home is $HOME")
my home is $HOME
>>> echo "my home is $HOME"
my home is /home/snail
constitutes progress in user experience. And that's from the tutorial (I appreciate the honesty though)Loading an entire development environment into your CLI is ten tons of bad news in a five pound bag.
... is not the same as the Bourne Again shell and scripting language, that IshKebab was talking about.
Likewise with bash, what's the better alternative? And don't say fish. Just because it bills itself as such doesn't make it an improvement. All tools have some overhead to learning them.
IMO, bash sticks around because a lot of people still find it useful.
Example: I have 2 mins to check if a duplicate line has occured in a log file with some arbitrary logging format. One pipeline later, I have an answer.