3 ms·
Disclaimer: this is not a defense for YAML, I'm just trying to remove the rose tinted glasses some people view XML configs through. As someone who has used XML
by eitland 5y ago
Disclaimer: this is not a defense for YAML, I'm just trying to remove the rose tinted glasses some people view XML configs through.
As someone who has used XML configs they have a few problems:
- technical: missing comments are mentioned multiple times here so I will mention that while XML has comments they cannot be nested.
- socially: for some reason (maybe because XML is structured enough that this doesn't immediately collapse?) XML tends to just grow and grow. People start programming in XML too, and not only using XSLT or other standard approaches but also in completely proprietary ways.
At one project someone even wrote an authorization framework in Apache Tiles which allowed one to create roles using somewhere between 600 and 5000 lines of XML pr role. The benefit was of course that you could update the roles without touching the Java code.
(In case it isn't immediately obvious: it would have been extremely much simpler to edit it in Java, and people who know enough Java to fix it are available at the right price, the XML system had to be learned at work.)
Personally I just want it to be kept simple:
- a settings.local.ini and default settings in settings.ini or something to that effect
- if necessary, just use a code file: config.ts works just as well, or config.js if it needs to be adjustable at runtime without transpilation.