[Tfug] Stored settings

Robert Hunter hunter at tfug.org
Mon Dec 8 18:56:40 MST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As programmers we often choose to use meaningful identifiers in our
code so that the intent of our endeavors are obvious to human readers.
Based on this principle, you may argue that data should be human
readable, as well.  However, if you think about it, the only thing
that is human readable (whether we are talking about source code,
image data, a configuration file, a relational databases, etc.) is
what pops up on our display.  The process of translating these
internal data representations to one that you (a human) can understand
is well defined within a specific context.

My point is that data representation and the meaning of said data are
two separate and equally necessary components of an information
vector.  For example, if I gave you 32 random bits, and asked you what
they represented, then you would probably be hard pressed to say
exactly what, unless I gave a specific context (e.g., a two's
complement integer, an IEEE single precision floating point, etc.),
*and* you were familiar with the specification of these data types.

And even if you decide to use English words for things such as
settings in a configuration file (e.g., EraseBootDriveOnPowerUp =
Never), inherent complexities (such as the ambiguity of natural
language), or introduced complexities (such as functional drift of a
program) could also cause confusion.  "What do you mean "Never"?
Never except when in Top Secret mode?  Never on Sunday?  Which "boot"
drive?  I have three of them!

Ultimately, you should use whatever data representation makes sense
for your application, *and* the meaning of the data should be
unambiguous.  Minimally, you should have a formal specification of the
data format, and, ideally, a robust set of tools for performing IO,
validating, and transforming your data.  This is one of the reasons I
increasingly use XML in my own work, but I only mention XML as an
example, and not as an exclusive, or even ideal solution.

- --
Rob

PS> I haven't top-posted in some time, so hopefully Claude will let me
slide this once.


On Mon, Dec 08, 2008 at 11:20:39AM -0800, Bexley Hall wrote:
> Hi,
> 
> Aside from "space efficiency" -- and some *trivial*
> performance (parsing) efficiencies -- I can't see why
> any "settings" should not be "stored" (maintained?) in
> human readable form.

> 
> E.g.,
> 
> EraseBootDriveOnPowerUp = Never
> FontServer = 10.0.1.71
> 
> vs.
> 
> EraseBootDriveOnPowerUp = 3
> FontServer = 0x0A000147
> 
> Of course, doing so presents I18N issues (but, those can
> be worked around).
> 
> Also, it seems like it is "better" to have the presentation
> of these settings in this form *without* the assistance (or
> even PRESENCE!) of the application(s) which support them.
> 
> So, are there any other reasons why you might opt for the
> "easy way out" (non-human-readable forms)?

I 




> 
> Thx,
> --don
> 
> 
>       
> 
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJPdBYJ1pz6tWxufARAumDAKCQ93NVRhwNaDFLaJYTmhGRHyVlOgCfbsue
xvNFrDEiuEQ3tkykoUsohG8=
=M47U
-----END PGP SIGNATURE-----




More information about the tfug mailing list