27-text-interfaces-are-the-most-user-friendly.md (5018B)
1 --- 2 title: "Text Interfaces Are The Most User Friendly" 3 date: 2021-05-27 4 draft: false 5 --- 6 7 The situation I was in had me dealing with a set of about 550k png images in a single directory extracted from a recovery image. 8 The images were extracted by Foremost on a partition that used to contain a root filesystem. 9 Since filenames weren't preserved, they weren't named in any way I could pick out the ones I wanted, and I could only go off of image metadata. 10 There was only a small portion of this massive library of images I needed to recover, and there was no way I could browse that many pictures to pick what I wanted. 11 Anything I was looking for was randomly placed in a sea of UI images or browser-cached icons. 12 13 I knew the images I wanted were likely to be larger than the majority of the rest, and listing images by size decreasing is simple. 14 However, PCManFM couldn't read the massive directory, and trying to browse it with Geeqie was also unusably slow on my old disk. 15 16 I was willing to sift through maybe a few thousand pictures, and I only needed to see the largest ones - maybe over 300x300 in resolution. 17 I realized I didn't really need a conventional file manager to do this. 18 19 ``$ feh -p --min-dimension 300x300 $(find . -maxdepth 1 -type f -printf '%s\t%p\n' | sort -n | tail -n $TOLERABLE_NUMBER | cut -f2)`` 20 21 It's not the most radical example of shell magic, 22 but it made me appreciate that a bash interpreter allowed me to make my own rules and answer to a dynamic query. 23 That snippet is equivalent to the statement: 24 25 ``In this directory, use an image viewer to show me a slideshow of the largest X images that are 300x300 or larger. With the smallest ones first, please.`` 26 27 Or, more literally: 28 29 ``In this directory, find files, and give me two fields, their size and name. Sort the entries numerically and give me the first X of those inputs. Now take the name field of each of these and pass them as arguments to the image viewer feh, truncating images whose resolutions are smaller than 300x300.`` 30 31 With Bash (or most shell language) syntax, the query could go on and on with manipulations or sorts I could do to arbitrary input. 32 The best part about this is that I don't have to wonder if something's a 'feature' of the program I'm using - it's a matter of using the tools in my toolbox to explain what I want to happen in an exact fashion. 33 34 A misnomer I hear all the time is that users are "scared away from using Linux (sic.)" 35 because there's something terribly awful and *un*intuitive about "the command line" that will cause a new user to suddenly go mad and have no choice but to quit before psychosis sets in. 36 37 This post is an argument to the contrary - the text interface of a shell is one of the most ingenious and user-*friendly* interfaces I can think of. 38 39 + Small programs that do one thing allow you to intuitively do nuanced things. 40 + Text is the most accessible medium - there are many ways to enter text. 41 + It's easy to share text with my friend. If he wants to do what I did, I can send him verbatim what I've just done. 42 + If the only I/O you have to worry about is text streams, then it's easier to extend scripts. 43 + Since Bash (or similar shell) is a programming language itself, I can save the text as a script and run it. 44 + I can access every one of my tools from the same interface. I don't have to learn a new button layout or general syntax to do something else. 45 + As long as a program takes input, and puts something out, it's useful. 46 47 These points might seem obvious, but I've never heard these points brought up from a UX perspective. 48 If you don't know what something does, you can peruse the manual and see exactly how you can use a program with no ambiguity. 49 The only real learning hurdle happens when you don't know something exists on your machine, 50 but most interfaces struggle with that problem somewhat. 51 Once you add a tool to your mental toolbox, you can use it forever. 52 I can use grep to apply a regular expression to input. 53 That input could be a file, but it could be input from anything else. 54 You kind of get this natural-language feel to it all. 55 grep is logically less a program and more a verb. 56 You don't have to be computer-savvy or a programmer to construct a query with some semantics that would be hard or almost impossible to do in an application where the developer has to attempt to accomodate each use case. 57 58 There are definitely programs that benefit from not being driven by a text interface, 59 and they mostly happen to be that way because the core of the purpose of the program can't be practically protrayed by text. 60 I'll never use GIMP with a CLI, nor will I play SuperTuxKart in the buffer - they are obvious cases. 61 62 However, there is still something to be said about the massive versatility of the text interface that can't quite be replicated by any interface that takes pride in their ease of use. 63 The definition of 'ease' in many minds is not "let the user easily do what they want" but rather "let the user easily do what we think they want."