There's nothing I hate more than text config files
I'm going to revisit an argument I had in… Ooooh… 2001ish? I wanted to make some edits to my university's fledging student union website. In order to do this, I needed to learn the arcane art of SSH. This was one of my first introductions to text based config files. I was horrified! A single typo, or a stray comma could break everything. The instructions our WebMaster provided were laughably unclear. Manually creating a config file - and getting it right - was a chore.
So I downloaded PuTTY and never looked back. It had a simple GUI. Well… simple enough. It was impossible to type an IP address into a box designed for a port number, it could tell that username was unlikely to contain a non-ASCII symbol, and that made it slightly easier to configure a connection.
The job of the computer is to do the hard work for us. Computers shouldn't recognise that we've made a mistake - they should stop us making mistakes in the first place!
Flash forward to today. I wanted to release an update to my NPM package of SuperTinyIcons - which are hosted on GitHub.
I figured that I'd have to click a link on GitHub, do the OAuth dance, click on a few GUI elements, and hit a big save button.
Nope!
I have to create YAML text files. Manually. Because it is the Year of Our Lord 2020 and computer engineering hasn't evolved since the earliest days of UNIX.
Don't get me wrong - I love the utility and versatility of the command line. I'll happily manually edit a JSON file in nano and use sed
to update a bunch of documents. I rely on diff
and grep
daily. But when it comes to configuring things - I am undone. I don't want to learn whitespace rules just to get something working.
Let's take a simple example. Here's a snippet of YAML from the official guide to releasing NPM packages via GitHub:
jobs:
build:
runs-on: ubuntu-latest
What are valid options for "runs-on"? Where would I find them? What are the differences between them? What happens if I spell something wrong?
Luckily, the GUI was invented to save us from ourselves:
M A G I C !
This goes for almost every element of the config file. If there are a set list of choices, present them to the user. If there is only one option, hide it. If there are two options, give them a checkbox.
The thing is, GitHub gets part of the way there. If you want to setup a webhook - you get a GUI.
Why does one part of GitHub offer a user-friendly way to manage configuration, and another part only provide a user-hostile environment?
To make it worse… NPM IS OWNED BY GITHUB!
I'm not saying you can't have a text file. I'm not trying to take your toys away from you. Have a sudo
mode which lets user hand-stitch a config together with butterflies and a binary keyboard. Go nuts!
Want to store the config in git so you can see what changes have been made? Brilliant!
To be explicitly clear - store the config in a text file. But have a GUI first, and expose the text file to any masochists who want to manually replace all the tabs with spaces.
I just can't be bothered reading 22 thousands words of YAML spec, a further two thousands words of GitHub instructions, and - no doubt - a hundred different StackOverflow questions, just to send data from one computer to another.
I heard someone say that part of Amazon's success was its relentless focus on convenience. How is manually creating fragile text files convenient for me?
We have to stop this fetishization of the text file as the primary method for configuring computers.
Or use both, for different things.
(And if you offer only a GUI, please ensure there’s a way to export the config: text is portable.)
Reply to original comment on twitter.com
|To configure it, you run fish_config, it boots up local web server and gives you UI. When you hit save, it writes all the changes to the correct config files (which you can then tweak/override). Much nicer than fiddling with bash/zsh config.
Reply to original comment on twitter.com
|Jon Ribbens says:
Poor documentation is a problem for text files as well as GUIs. But at least a GUI tells you want fields are, and what valid options you can choose.
Martyn says:
Providing a GUI also implies that the application is being configured somewhere that the GUI can be displayed. It may be 2020, but many servers are still handled remotely via the CLI, because it's generally sufficient for task at hand and an efficient use of resources on the target server and bandwidth.
Further more, the authors skill set or time available may not extend to developing a GUI and documenting the app. If the choice was between a configuration GUI with options, but no documentation to tell you what they meant and no GUI, but sufficient documentation to allow you to take a stab at configuring in a text file, which one would you choose?
Providing a GUI doesn't imply that only a GUI can be used. As I said above. Store the resultant file as text, json, xml, yml, or whatever. Let people edit it via SSH if they want. But give people the option of a modern GUI.
Your last point... Most open source software is poorly documented. Even GitHub's documentation for their text based tools is terrible. The Alexa documentation is similarly awful. But a GUI gives discoverability in a way that an empty text file doesn't.
Look, if the config file said:
Then I'd be able to use it almost as easily as a GUI. But almost no one does that.
Isabel says:
Dave says: