Live data from Hacker News

Textual configuration has comments, GUIs don't.

machinesplusminds.blogspot.com

21–28 of 28 posts

Re: Textual configuration has comments, GUIs don't.

#21
post #18
post #12

A bigger feature missing in most GUIs is that I can't tell what has changed from the defaults. On the other hand, most text configuration files contain only what has changed from default, which is exactly what I want to know.

I would say the biggest problem with text configuration files is that you can't ever be sure what the default is. The problem is that: 1. Config files need _visible_ defaults 2. Config files need to show current values 3. _Config files need comments_ 4. Config files need to be small or they get unreadable Doing all four is tricky. Postfix gets close: postconf will show you all config entries. Add -d to get defaults i…

The problem of making the defaults transparent has been solved a long time a go.

Standard convention for a lot of software is to have one config file (for instance often with the extension .dist) with all the default settings, and lots of comments about them, and a local config which is the one you edit.

Re: Textual configuration has comments, GUIs don't.

#22
post #21
post #18

Earlier quoted context omitted.

I would say the biggest problem with text configuration files is that you can't ever be sure what the default is. The problem is that: 1. Config files need _visible_ defaults 2. Config files need to show current values 3. _Config files need comments_ 4. Config files need to be small or they get unreadable Doing all four is tricky. Postfix gets close: postconf will show you all config entries. Add -d to get defaults i…

The problem of making the defaults transparent has been solved a long time a go. Standard convention for a lot of software is to have one config file (for instance often with the extension .dist) with all the default settings, and lots of comments about them, and a local config which is the one you edit.

Yes so essentially you have the commented defaults config file (under /usr/share or hopefully under /etc) and you overwrite non-default settings.

It should all be so simple, but most programs still don't do it.

Re: Textual configuration has comments, GUIs don't.

#23
post #3

Unless the config file uses JSON as a format. Then no comments for you!

I've done something like this: {"height": 100, "width": 150", "__comment__": "This is a comment"} Of course depending on the implementation details this may keep the comment string in memory. I agree JSON should have native comments, as well as optional trailing commas.

I don't think JSON as a _data interchange format_ should have comments. Key factors contributing to JSON's popularity and great practical value is simplicity and the fact that JSON is a final specification (i.e. no versioning, no extensions, no backward compatibility requirements).

Although JSON is human-readable, it wasn't specifically designed for human interaction. There are other projects and languages that address this specific topic. For example, Yaml and Piq. (Piq is the one that I'm working on as a part of the Piqi project -- http://piqi.org).

Re: Textual configuration has comments, GUIs don't.

#25
post #6

While I do prefer text configuration over guis, I had two thoughts that kind of run counter to his point: 1) There's nothing inherent about guis that prevents them from having a space for comments. Perhaps gui designers should consider leaving spots for comments in complex config situations. 2) A lot of the comments I see in config files are little notes about what this or that setting actually does... comments that…

Comments in configuration files are approximately equivalent to those "tooltip" things GUIs sometimes have. I think comments are a much better method though since GUIs often seem to be missing their equivalent and even when present, it's a pain in the ass to use.

I disagree. Comments in configuration files can serve (at least) two purposes:

- to explain what a setting does.

- to document why you chose a value for the setting.

Tooltips can do the former, but not the latter.

Re: Textual configuration has comments, GUIs don't.

#26
post #25

Earlier quoted context omitted.

Comments in configuration files are approximately equivalent to those "tooltip" things GUIs sometimes have. I think comments are a much better method though since GUIs often seem to be missing their equivalent and even when present, it's a pain in the ass to use.

I disagree. Comments in configuration files can serve (at least) two purposes: - to explain what a setting does. - to document why you chose a value for the setting. Tooltips can do the former, but not the latter.

Yes, I am revering to point 2 of the GP.

Re: Textual configuration has comments, GUIs don't.

#27
post #9

"There is no good way to put comments into GUI." Maybe he hasn't seen any, but this seems a harsh conclusion. Whoever wrote the GUI could track history of changes, make comments required, and show it in the GUI. There is a vast difference between "there is no way", and "I haven't seen it done right"

The ultimate graphical configuration editor, Smalltalk, does all of this. It even puts text fields labelled "comment" where the user is likely to want them. Which is configurable, in case the user wants them elsewhere.

Re: Textual configuration has comments, GUIs don't.

#28
We at OpenLieroX actually tried to solve this for game settings. OLX is a 2D shooter-like game.

In the game settings dialog, for each setting which was changed by the user, it shows a 'reset' button next to it. Also there is a way to just show the changed settings.

You can also filter the settings by how advanced you want to go (a bit similar like in VLC but with more levels).

And when you hover one setting, there is a comment section below the dialog which describes the setting.

Post reply on HN