3 ms·
Programs should have a UI that make them as useful as possible. For a large client app “useful” means discoverable, efficient. For a small text utility such as
by alkonaut 8y ago
Programs should have a UI that make them as useful as possible. For a large client app “useful” means discoverable, efficient.
For a small text utility such as “grep” a good UI night absolutely be CLI.
I don’t see how someone would argue that a photo editing app, music workstation, IDE, CAD program etc would somehow be better because it had a graphical UI that was layered “on top” of something that was textual?
I think some of the Unix people bashing (no pun I intended) GUIs just don’t use programs where GUIs shine. Sure there are cases where a GUI could and should be layered on top, but for complex media apps it normally doesn’t make sense.
- iforgotpassword 8y agoI agree, there's always types of programs where one beats the other. I will never argue that a CLI browser, photo editor (if it exists?) or IDE for say Java has any advantage over a GUI. It's the stuff "in the middle" where it gets interesting. Even if you only consider power users or developers, many times the Windows user still resorts to GUI apps either out of habit or since there is no built-in CLI solution to the problem, and if you need to download anything anyways you might just go with a GUI app. But let's take find as an example: as a power user you might want something a little more involved than what the window search GUI offers, but as soon as you end up with something that involves AND and OR expressions a GUI is already subpar, and then you might want to process the files so you need either an "export to text file" function, or the ability to specify a command to execute. And even if the tool offers both, it's still hard to impossible to automate that task. You might find yourself ending up trying a dozen different file search utilities since you find one you manage to actually embed in an automated workflow. My experience is that Windows people just don't automate in many cases, although it's obviously absolutely possible to get all the GNU tools etc. on Windows too. They're just not being used that much.
- TeMPOraL 8y ago> photo editor (if it exists?) ImageMagick. Mighty efficient, if you know what you want to do, and need to do this on couple hundred images.
- iforgotpassword 8y agoSure, I was more thinking of hand tuning a photo (retouch, cover up, remove a person in the background). But even if you just tweak contrast and brightness a GUI probably still wins if you don't know the exact values you want to apply beforehand. But batch processing on its own is another great example where CLI shines. With GUI apps you have to rely on the app shipping that feature, and then it's almost guaranteed it works slightly different in every app, has different semantics, hidden in a different spot etc. On the command line, the batch processing is external to the tool doing the processing, constructed using features of the shell, so once you understood how to batch process with one utility, you can do it with everything.
- TeMPOraL 8y ago> I don’t see how someone would argue that a photo editing app, music workstation, IDE, CAD program etc would somehow be better because it had a graphical UI that was layered “on top” of something that was textual? Because then you could use all the advanced capabilities of those applications in batch mode. I'll grant you CAD apps here (as did the OP), though decent CADs are at least thoroughly scriptable, and then there's space for text-oriented tools like OpenSCAD. As for the rest of your examples: decent IDEs are already text-and-keyboard-oriented (even if they present text oriented spatially), and it would be a small step to expose their capabilities to the command line for e.g. batch processing. Photo editing app - it's cool to click around, but then if you have to do this on 2000 photos, there's ImageMagick to the rescue. Music workshops - I haven't worked with those much, but I'd assume the case is somewhat similar to photo editing, except with audio as the output. I do feel that the original article goes a bit overboard with praising CLIs, but I also think that a weaker version of that proposal is very much defendable - exposing software capabilities to CLI leads to both more efficient workflows and creates new workflows. More efficient, because of batch processing. New workflows - because now I can do at least some of those tasks e.g. via SSH from my phone, or via a Slack bot, or whatever. And with such capabilities, you could then add e.g. "export CLI command" button to your GUI, so that I could e.g. do some processing and experimentation on one photo, and then copy a CLI command that will repeat that on the whole folder.
- alkonaut 8y agoRight, a CLI is just another UI. Regardless of whether your app has a CLI, GUI, or both normal architecture rules apply. I’m arguing that usually the best design is a core as a library api with CLI and GUI being two independent applications. The mistake that is made for some applications in the Unix world is that the CLI app is used as the API, so they are not independent (and the CLI can’t change without breaking guis.
- ajuc 8y ago> I don’t see how someone would argue that a photo editing app, music workstation, IDE, CAD program etc would somehow be better because it had a graphical UI that was layered “on top” of something that was textual? inkscape has "headless" cli mode, I've used it for batch processing svgs, and (independently) seen it used in similar manner in one of the companies I worked for. I use mainly mplayer on linux for playing music/videos and simple processing (for example changing speed or encoding). You can argue it's not CLI app because it opens a graphical window, but it has text-only interface and additionally some gui, exactly as the article suggested. Emacs and vi serve as an ide for many people, but these are just text-mode GUIs, what's important is that some of their capabilities can be also used in batch mode (for example - let's say you want to refactor 100 methods in 30 files - woudln't it be nice to be able to write a small for loop and call some cli app to do that?) I don't know much about CAD but I suspect text mode for doing repetative parametric work would be useful as well.
- alkonaut 8y agoI’m not arguing that scripting or batching is not useful - I’m only arguing that that a CLI is usually not a good base to build the GUI on top of. Having a libsomeghing and a something-cli and something-gui is a perfectly good solution, but usually not if the GUI calls the CLI instead of the lib.
- ajuc 8y ago> Having a libsomeghing and a something-cli and something-gui is a perfectly good solution That's what he proposes? > The GUI wrapper should be a separable module. If they're plug-replaceable, the application isn't irretrievably wedded to any specific GUI technology... > This means your program should be runnable both with and without the GUI present, and accept input from a mouse or under programmed control. Preferably that means both a shell-level interface for convenience and a C-level interface for efficiency; Perl programmers could elect either method. That way, naive users can use push-button GUIs, blind users can use Braille terminals, and sophisticated users can program solutions to intricate problems. Basically he says we need to use model-view-controller architecture to write desktop applications.
- HeadsUpHigh 8y agoThe argument is not about having complex CLI only apps. The argument is that by having a separate GUI frontend and a backend with a CLI interface: 1) Your app becomes much less dependent on the platform and the toolkits you use 2) Even if the CLI interface is cumbersome to use manually someone can use it for scripts that can then do batch processing of whatever your application does including piping with other applications. Long story sort linux has a great mechanism for making user-friendly applications that retain advanced features via shell scripts.