From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47bc849aad30d586 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-30 02:03:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!newsfeed00.sul.t-online.de!t-online.de!nautilus.eusc.inter.net!eusc.inter.net!cs.tu-berlin.de!not-for-mail From: Volkert Barr Newsgroups: comp.lang.ada Subject: Re: A standard package for config files is needed Date: Thu, 30 May 2002 11:03:00 +0200 Organization: TU Berlin, Fachbereich Informatik Message-ID: <3CF5EAC4.865A87C@cs.tu-berlin.de> References: <3CF5D7AC.975B0DB3@cs.tu-berlin.de> NNTP-Posting-Host: bolero.cs.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.cs.tu-berlin.de 1022749380 4622 130.149.19.1 (30 May 2002 09:03:00 GMT) X-Complaints-To: news@cs.tu-berlin.de NNTP-Posting-Date: 30 May 2002 09:03:00 GMT X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:24996 Date: 2002-05-30T09:03:00+00:00 List-Id: tmoran@acm.org wrote: > > > 2) a config file should store information in plain ASCII, so a > > user can easily modify them by hand! > > 3) the config file should be simple organized: > > - All entries sould be of the form "scope.key := value" > > - Ada-like comment blocks > In a particular Windows program of mine the user can modify the color > settings (via the usual Windows color dialog), and the program will > save his preferences in the registry. This is done with: > > type Shelf_Palettes is record ... > procedure Stash_Palette is new Claw.Registry.Write(Shelf_Palettes); > ... > Stash_Palette(Claw.Registry.HKEY_CURRENT_USER, > "Software\Decision Aids\Shelves", > "Palette", > Saved_Palette); > > That's pretty simple. It appears to me you are suggesting that instead > I should write code to convert every element of Shelf_Palettes to a string > and write it out preceded with some suitable, human understandable, > "name=", and also write code to read such stuff back in, complete with > error handling when the user has botched up that text file. That would be > a tremendous regression and I can't imagine anybody doing it. Why should > the config file be an easily edited ASCII file? Did everyone enjoy > editing .ini files in old Windows so much? How often in current Windows > programs do users modify the config by doing things in the app (like the > color palette above), and how often do Windows users change a > configuration by using regedit? > Considering how often real users should need to edit a config file > independently of the app or its Install program, I'm inclined to suggest > it would be easier to just read/write records in binary and tell the > user to use "debug" if he needs to modify them manually! > There are also the questions of where the config file is stored, and > how multiple users of the same machine can have different configurations. > The Windows registry certainly is an all too common failure point and as > a sort of parallel file system it's painful to backup/restore or uninstall > programs, but improvements in config files are not, I suggest, to be found > in better syntaxes for an ASCII text file. I have used this simple style in some projects to configure distributed systems. This works satisfactory good and the customer was easily able to set up (reconfigure) the whole system ... so what is wrong with simplicity!? Volkert -- - - - - - - - - - - - - - - - - - - - - - - - - - - - Volkert Barr Institut fuer Softwaretechnik und Theoretische Informatik Fachgruppe Softwaretechnik * TU Berlin email: barr@cs.tu-berlin.de web: www.cs.tu-berlin.de/~barr - - - - - - - - - - - - - - - - - - - - - - - - - - - * macrosolutions to megaproblems * -- - - - - - - - - - - - - - - - - - - - - - - - - - - - Volkert Barr Institut fuer Softwaretechnik und Theoretische Informatik Fachgruppe Softwaretechnik * TU Berlin email: barr@cs.tu-berlin.de web: www.cs.tu-berlin.de/~barr - - - - - - - - - - - - - - - - - - - - - - - - - - - * macrosolutions to megaproblems *