Hi,
I thought I would pose this question in a new thread seeing that the other thread got totally high-jacked (and not by me for a change). :)
I'm curious to know what was the reason behind the decision to use XML for storing simple Lazarus settings, instead of the much simpler INI format? This is a legit question and I'm very curious as to the answer. Please note, this is not a feature request or me telling the Lazarus devs to change yet another thing in Lazarus. This is simply me asking a question I don't have an answer too.
Here are some points that were raised before:
* FCL, LCL and Lazarus IDE have XML read/write code. They don't all work the same, and I doubt they all have the same functionality.
* Not all code in Lazarus IDE uses the same XML read/write code
* Most XML examples in my ~/.lazarus/ directory would be much simpler presented if they where INI files.
* FPC and Delphi has brilliant INI file support, and it's dead easy to use.
* What is the actual advantage of XML in this case or was it chosen simply because XML was the flavour of the month at time of implementation. Yes, at one point everything had to be XML or it just wasn't cool. :-)
* Reading INI fast is FAST.
To make others understand my confusion regarding the XML choice, here is an example, using the compileroptions.xml file located in my ~/.lazarus/ directory.
-------------------[ compileroptions.xml
]-------------------------------------
<?xml version="1.0"?>
<CONFIG>
<CompilerOptionsVersion Value="8"/>
<CompilerOptionsSearchPaths>
<IncludeFiles Value="$(ProjOutDir)/"/>
<UnitOutputDirectory Value="units/$(TargetCPU)-$(TargetOS)/"/> </CompilerOptionsSearchPaths>
<CompilerOptionsParsing>
<SyntaxOptions>
<UseAnsiStrings Value="True"/>
</SyntaxOptions>
</CompilerOptionsParsing>
<CompilerOptionsOther>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</CompilerOptionsOther>
</CONFIG>
-----------------------------------------------------------------------------------------
This is a relatively small example, but still highlights my point. Just looking at it gives me a headache. ;-) Now lets convert that to a INI styled file.
BTW: Does anybody know what INI actually stands for? Initialization maybe?
-------------------[ compileroptions.ini
]-------------------------------------
[SearchPaths]
IncludeFiles=$(ProjOutDir)/
UnitOutputDirectory=units/$(TargetCPU)-$(TargetOS)/
[Parsing]
UseAnsiStrings=1
[Other]
UseMsgFile=1
CompilerPath=$(CompPath)
---------------------------------------------
Now both examples contain the same information, but lets be honest.. Which one is easier to read (via human or program), manually tweak if needed via human in IDE screws up, takes up less disk space.
I fully understand that XML has it's place in data transport and helps describe complex data. But using XML for something as simple as storing a few application settings. It just seems very inappropriate in this case, and a classic example of over-engineering.
