There exists a peculiar amnesia in software engineering regarding XML. Mention it in most circles and you will receive knowing smiles, dismissive waves, the sort of patronizing acknowledgment reserved for technologies deemed passé. "Oh, XML," they say, as if the very syllables carry the weight of obsolescence. "We use JSON now. Much cleaner."

you are viewing a single comment's thread
view the rest of the comments
[–] 11 points 9 months ago (22 children)

Except config files. Please don't do config files in json.

  • source
  • parent
  • hideshow 22 child comments
  • [–] 2 points 9 months ago (11 children)

    Why not? It works great in Python.

  • source
  • parent
  • hideshow 11 child comments
  • [–] 6 points 9 months ago (10 children)
  • [–] 4 points 9 months ago (6 children)

    And no comments, unless you use a non-standard parser. But then you might as well use anorher format.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 5 points 9 months ago* (5 children)
    {"comment": "Who says you can't do comments in JSON?"}
    
  • source
  • parent
  • hideshow 5 child comments
  • [–] -1 points 9 months ago (2 children)
  • [–] 3 points 9 months ago (1 child)
    {"comment2": "I can do this all day."}
    
  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 9 months ago

    Now put a newline in your comment, to make it readable. Clearly you can see the problem here right? “comment2” isn’t a comment. It’s a key with a value. Numbering them doesn’t actually fix anything, in fact it makes it much much harder to maintain.

  • source
  • parent
  • [–] 2 points 9 months ago (2 children)

    JSON is super easy to read and write though. Just needs a parser that allows comments...

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 9 months ago (4 children)
  • [–] 5 points 9 months ago (2 children)

    Yaml is dogshit format. If you need tree-like structure use json if you need list of props use toml or simple key value pairs. I fucking hate app properties in yaml.

    • can’t search shit
    • copy-paste doesn’t “just work” when you want to merge two files
    • your editor doesn’t show whitespaces and you messed up somewhere - valid but incorrect
    • messed up formatting your list of banned IPs/hosts/ports/users/subnets/commands - get pwned

    It should’ve never left the basement of crackhead who thought “let’s make schema-less format depend on number of invisible characters”.

    I’ll rather save my data in Copybook and record it on tape then use this Python-bastardized abomination

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 9 months ago (1 child)

    Oh nice! I didn'tknow toml, so I looked it up a bit. Atfirst I was like "this is just .properties with a better typing support". Than I saw the tables and the inline tables, which is a really neat way for complex nesting. It reminds me of json, but better. I'll see if I can start using this somewhere.

  • source
  • parent
  • hideshow 1 child comment
  • [–] -1 points 9 months ago (4 children)

    Json configs read much cleaner to me since .net swapped to them a while back.

    Xml is incredibly verbose when there's a 12k loc web.config.xml

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 9 months ago* (3 children)

    Then do a cfg or ini style config or make multiple config files. YAML/TOML if you can't make it simpler. The neccessity for complex config formats is a fuckup of the dev.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 9 months ago (2 children)

    Or you work in an environment that's still using Full Framework and ASP.NET Webforms.

    These places exist, and they are unfortunately not rare.

  • source
  • parent
  • hideshow 2 child comments