[Tfug] Stored settings

Jim Secan jim at nwra.com
Tue Dec 9 13:48:23 MST 2008


At 12:37 PM 12/09/2008 -0800, you wrote:
>Hi, Jim,
>
>> >So, are there any other reasons why you might opt for the
>> >"easy way out" (non-human-readable forms)?
>> 
>> Only the ever-popular LP (Lazy Programmer) Syndrome.
>
>Well, it can also be argued (?) that it is more robust
>(in that the range of legal values is more tightly constrained
>as in your comment below).
>
>OTOH, one could argue that a "textual" representation tends
>to have a larger Hamming distance and, in theory, easier to
>recover from database corruption  :-/
>
>(though I sure as hell wouldn't want to be writing the
>code that makes those judgement calls!)
>
>> I agree - these days there is no reason for info or config
>> files to be in a
>> machine-readable-only form.  Of course, using "3"
>> in your example instead
>> of "Never" simplifies things so that the
>> programmer doesn't have to look
>> for "Never" "never" "NEVER"
>> "N3ver" "NotInMyLifetime" etc.
>
>strcmp(tolower(value),  TOLOWER("Never"))

Somehow I knew you'd say that.  That's why I threw in "N3ver".

Your point about using this to look for a corrupted file is an interesting
take on things.  I typically put some long text string in various places in
files that I want to check automatically for corruption at an idiot level.

But on the core issue, I think human-readable in config and info files is a
must.  I went with XML for a while (a SHORT while) for these types of files
until I realized that it failed the human-readable (with vi or notepad)
test big-time (the realization coming when I revisited some old XML config
files and could not figure out what they meant without RTFM).

Jim
*---------------------*-------------------------------*
| Jim Secan           | Northwest Research Assoc, Inc |
| (jim at nwra.com)      | 2455 E. Speedway, Suite 204   |
| (520) 319-7773      | Tucson, Arizona 85719         |
*---------------------*-------------------------------*




More information about the tfug mailing list