[openbeos] Re: decoder config options

  • From: Gabriele Biffi <mlist@xxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 20 Feb 2008 22:20:23 +0100

Alexandre Deckner wrote:
I've always been thinking about the binary/gui vs text config file question, from the programmer and user perspective.
I've accumulated some random thoughts :)

Please let me do some corrections to your thoughts :-)


Data in plain text pros and cons:
1) + the editor is standard, any ascii editor will do the job. Cool for the user and the programmer.

True.


2) + it allows to edit the data like a document or program, ex: you can copy and paste data between two opened editors or a web page, ex2: you can easily compare two files

True.


3) + it allows comments / examples / documentation directly in the file (although plain english ascii can be limiting)

Not exaclty. We are UTF-8, we can write in any language.


4) - as a user, the editor can't check for you that your changes are syntactically and semantically valid until you throw the config at the corresponding program.

True.


5) - it is hard on the programmer side if you need more than a couple <name,value> pairs. Checking the data for syntax and semantic errors can be difficult.

Not exaclty. Checking for semantic is easy and you've to do it even with binary files. The syntax check can be done by a common loading function, if Haiku (or some library) has one.


Well xml could solve part of 4 but with a standard text editor the user can still make mistakes, besides it's harder to read. A specialized xml config format and xml config editor could solve that. On the bright side, xml partly solves 5, but the programmer still needs to define how to organize his xml format and do some high-level work.

True.


Graphical config editors with a file format which implementation is hidden from the user, a.k.a binary file! After all, text is also binary, it's just implemented in english text!) 1) - the editor is not standard. The user might not be familiar with the ui and the programmer need to program check boxes and menus which is not fun. 2) - you cannot edit the data like a document, copying a config from the web or a doc needs you to verify each checkbox or value and their position. 3) ++ as with plain text, it allows comments / examples / doc and much more: menus, tooltips, hyperlinks, presets, multilangage, graphics etc..


Wait - there shouldn't be a need for a separate config application at all! All the configuration should be done inside the application itself. But if we stick to a common format, the power user can use a generic editor (and if we use text files, we don't need one at all, but we can still make one if we want).


4) + contrarily to plain text, your changes are always valid, the user interface is here to enforce that.
> 5) + it can be easyer on the programmer because he can use brute force,
> object/message dumps, and you are sure the data is conform due to 4.

Not really. A binary file can be altered via a binary editor or otherwise damaged, so you still have to check it.


I think that the best way to go are text files (easier for the user), and a set of functions to make them easy for the programmer as well.


Gabriele


Other related posts: