|
|
Log in / Subscribe / Register

Useability is not good

Useability is not good

Posted Dec 18, 2025 19:49 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: Useability is not good by mbunkus
Parent article: Conill: Rethinking sudo with object capabilities

> - XML: even less type information than any of the others

That's not quite correct. There's XSD that even allows you to restrict numbers to a specific subset.


to post comments

Useability is not good

Posted Dec 19, 2025 10:25 UTC (Fri) by mbunkus (subscriber, #87248) [Link] (2 responses)

You're correct that with additional, out-of-band information you can map it unambiguously, but there's out-of-band info for other formats, too, e.g. JSON schema.

What I meant was that the following XML cannot be read by naive parsers & converted into hash-array structures without an additional information such as a stylesheet or hints to the parser:

<xml>
  <settings>
    <something>42</something>
  </settings>

  <auth>
    <option/>
  </auth>
</xml>

First of all, the program might expect <settings> to be either a hash or an array; it't not obvious just from a stylesheet-less XML alone. Here are two possible corresponding JSON representations:

{
  "settings": {
    "something": 42
  }
}

or even

{
  "settings": [
    { "something": "42" }
  ]
}

Second, there's no info about the type of <option> either. It might be: an empty string; a None/undefined/null type of value…

Of course this is because XML is capable of expressing more complex structures than nested hash-arrays, but most programs nowadays use nested hash-arrays for any kind of configuration information — because it's more or less natural to build such structures, they're trivial to implement in most programming languages, they map cleanly to all kinds of binary & text representations. XML's flexibility & capabilities are to its detriment when considering to use it as a human-maintainable configuration format.

For me an ideal human-maintainable format has a couple of properties:

  • allows for comments (JSON loses here)
  • has in-band structural information to make tooling a viable option (pretty printing, structure validation, auto-indenting in an editor, easy navigation with "jump to key XYZ…" functionality; YAML loses here)
  • makes it harder to mess up the format (YAML & XML lose here)
  • does have little repetition in what I have to type all the time (XML & TOML lose here)
  • is optically easy to grasp for us meatbags, not just agile computers (YAML loses here, but so does JSON when you have to deal with long strings)

I did not actually know about textproto which NYKevin has just mentioned. I will definitely look into that.

Useability is not good

Posted Dec 19, 2025 21:27 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

Yeah, if you want to carry all the information in-band then there's no real good option. Integers/booleans are especially trippy. E.g. is 129387 an int32 or int64? Then what about JavaScript?

Useability is not good

Posted Dec 20, 2025 9:28 UTC (Sat) by Wol (subscriber, #4433) [Link]

Until the target system importing (or exporting) the JSON just doesn't care - it could be a straight infinite precision integer (or number) ...

Cheers,
Wol


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds