5 ms·
>it's as bad or worse than XML for config files XML works very well for config files. It's schema-optional (but is there), well-specified, human-readable, has
by macspoofing 8y ago
>it's as bad or worse than XML for config files
XML works very well for config files. It's schema-optional (but is there), well-specified, human-readable, has plethora of supporting technologies (making things like templating easy), and is well supported by every language.
At the very least it is way better than JSON.
- Macha 8y agoIt's missing one important part for config files. It's tedious to write by hand.
- titanix2 8y agoXML is not tedious at all with the right tooling. For example a tool like Visual Studio IntelliSense proposes only elements and attributes valid in the context, automatically close tag, format the file and complete opening tags too so it makes editing XML file a breath.
- MrStonedOne 8y agoThe tooling bar for config files is set firmly at notepad.exe If your config file requires more tooling than that you fucked up.
- heavenlyblue 8y agoI mean, with Visual Studio I can even the change the code of the application I am running on the fly, depending on what exactly I am configuring :) That doesn’t make XML an easier format to maintain.
- macspoofing 8y agonotepad is a terrible editor for anything other than simple property files. For example, editing JSON that has any sort of complexity would be just as painful.
- int_19h 8y agoNot really. For quick authoring, configs should have pre-authored snippets for common things, that are commented out, and have adjacent descriptive comments ("Uncomment the following to ...") - this is regardless of their syntax. And for complicated stuff, you're going to spend a lot more time reading the manual than you will actually typing those closing tags. In fact, in most cases you'd be copy/pasting bits from the manual as well.
- guitarbill 8y ago> human-readable technically yes, practically maybe not so much, especially with e.g. CDATA sections
- smittywerben 8y agoHe means Cantor's XML you barbarian.
- macspoofing 8y agoIf we're talking about a human-editable configuration file, then yes, it will be quite human-readable. Machine generated XML can be noisy but the target for those are other machines, and the extra context is there for a reason. You can certainly make XML as obtuse and complex as you want.
- Gibbon1 8y agoTwo examples from two IDE's. Codelite's xml based project files can be easily read and modified by hand. Diffing them yields useful information about files added and moved, config values changed, etc. Eclipses project files also written in xml are an Eldritch Horror. I think the failing of xml is also it's strength. It doesn't do typing and schemas, doesn't even try. Which means that can be sane. Or not.
- eadmund 8y agoThere's absolutely no way that this (copied from https://github.com/akeeba/fof/wiki/The-XML-configuration-file https://github.com/akeeba/fof/wiki/The-XML-configuration-fil...): <?xml version="1.0" encoding="UTF-8"?> <fof> <!-- Common settings --> <common> <!-- Container configuration --> <container> <option name="componentNamespace"><![CDATA[MyCompany\MyApplication]]></option> </container> <!-- Dispatcher configuration --> <dispatcher> <option name="defaultView">items</option> </dispatcher> <!-- Transparent authentication configuration --> <authentication> <option name="totpKey">ABCD123456</option> <option name="authenticationMethods">HTTPBasicAuth_TOTP,QueryString_TOTP</option> </authentication> <!-- Model configuration. One tag for each Model. --> <model name="orders"> <!-- Model configuration --> <config> <option name="tbl"><![CDATA[#__fakeapp_orders]]></option> </config> <!-- Field aliasing. One tag per aliased field --> <field name="enabled">published</field> <!-- Relation setup. One tag per relation --> <relation type="hasMany" name="items" /> <relation type="belongsToMany" name="transactions" localKey="foobar_order_id" foreignKey="foobar_transaction_id" pivotLocalKey="foobar_order_id" pivotForeignKey="foobar_transaction_id" pivotTable="#__foobar_orders_transactions" /> <relation type="belongsTo" name="client" foreignModelClass="Users@com_fakeapp" /> <!-- Behaviour setup. Use merge="1" to merge with already defined behaviours. --> <behaviors merge="1">foo,bar,baz</behaviors> </model> <!-- Controller, View and Toolbar setup. One tag per view. --> <view name="item"> <!-- Controller task aliasing --> <taskmap> <task name="list">browse</task> </taskmap> <!-- Controller ACL mapping --> <acl> <task name="dosomething" /> <task name="somethingelse">core.manage</task> </acl> <!-- Controller and View options --> <config> <option name="autoRouting">3</option> </config> <!-- Toolbar configuration --> <toolbar title="COM_FOOBAR_TOOLBAR_ITEM" task="edit"> <button type="save" /> <button type="saveclose" /> <button type="savenew" /> <button type="cancel" /> </toolbar> </view> </common> <!-- Component backend options --> <backend> <!-- The same options as Common Settings apply here, too --> </backend> <!-- Component frontend options --> <frontend> <!-- The same options as Common Settings apply here, too --> </frontend> </fof> is at all preferable to this: (fof (common (container (component-namespace "MyCompany\\MyApplication")) (dispatcher (default-view items)) (authentication (totp-key ABCD123456) (authentication-methods (http-basic-auth-totp query-string-totp))) (model orders (config (tbl "#__fakeapp_orders")) ;; Field aliasing. One tag per aliased field (field enabled published) ;; Relation setup. One tag per relation (relation items (type has-many)) (relation transaction (type belongs-to-many) (local-key "foobar_order_id") (foreign-key "foobar_transaction_id") (pivot-local-key "foobar_order_id") (pivot-foreign-key "foobar_transaction_id") pivot-table "#__foobar_orders_transactions") (relation client (type belongs-to) (foreign-model-class "Users@com_fakeapp")) ;; Behaviour setup. Use merge="1" to merge with already defined behaviours. (behaviors (merge 1) (foo bar baz))) ;; Controller, View and Toolbar setup. One tag per view. (view item (taskmap (list browse)) ;; Controller ACL mapping (acl (task dosomething) (task somethingelse core.manage)) ;; Controller and View options (config (auto-routing 3)) ;; Toolbar configuration (toolbar "COM_FOOBAR_TOOLBAR_ITEM" (task edit) (button save) (button saveclose) (button savenew) (button cancel)))) (backend) (frontend)) There's just no way.