Hacker News new | past | comments | ask | show | jobs | submit login

> XML schemas give you a ready-to-use format to describe, restrict and document available configuration settings.

As someone that likes and uses s-expressions, I never thought I would find myself defending XML, but here we are in 2019, no one understands basic parsing theory anymore, and file formats have "evolved" to hot garbage like YAML and TOML.

XML has some great tools in comparison:

http://xmlsoft.org/xmllint.html https://relaxng.org/

> But for markup... we may be better off to just use markdown inside CDATA blocks

SGML can still make a comeback: https://leancrew.com/all-this/2014/09/sgml-nostalgia/




YAML and TOML were optimized for human reading and writing, like markdown. XML & even JSON are not as human optimized, but still human usable.


> YAML and TOML were optimized for human reading and writing, like markdown.

That was the rationalization, in reality I don't know what actual writing use case they were optimized for (Notepad?). XML in a syntax-aware editor with the help of automatic schema validation makes it far easier to write than YAML or TOML.


I don't need a special editor to write out YAML (if it didn't have tab dependence) or TOML quickly. It's also a lot faster for a human to read vs XML. JSON is fairly readable, but a bit of a pain to write out compared to ini files, since you have to quote all strings.

If your going into complicated things like schemas or other complicated structures, then you probably shouldn't be using YAML or TOML. I would mostly use it for config or other simple things.

At this point if you are not interacting with 20 year old java software, that was created when JSON didn't exist and XML was king, you should be using TOML for simple config, JSON for most things and heavyweight XML, protobuf or csv for the specialized cases. And while we are at it, markdown for simple documentation.

Even gradle decided to use groovy scripts as their config language because it's far more human readable and usable.


> At this point if you are not interacting with 20 year old java software, that was created when JSON didn't exist and XML was king, you should be using TOML for simple config, JSON for most things and heavyweight XML, protobuf or csv for the specialized cases.

You should be using S-expressions.


Humans should not interact with computers by manually editing data structures serialized to ASCII.


The alternatives are usually worse.


But we can't always budget a nice configuration application.

And once we've just put simple XML file there for configuration and we're past the prototyping phase... "well this actually works good enough, let it be".


You likely need data model classes for the config anyway, along with support of serialization and deserialization (XML or not is not important). Use a stock property grid control, pass the root object of the config, and you’ll get a GUI that does the job much better than ASCII files.


> SGML can still make a comeback

Hey, you should checkout http://sgmljs.net (my project).


Very cool!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: