r/ProgrammerHumor • • 11d ago

Meme formatsWithSuperiorityComplex

Post image
3.0k Upvotes

403 comments sorted by

View all comments

56

u/RomanOnARiver 11d ago

At least you're not staring at XML all day. Or worse, INI. Remember INI files? I was using INI for way longer than I would like to admit.

At least with JSON I can do the bit where I sing "JSON Derulo" to myself.

18

u/oldsecondhand 11d ago

I'd take XML.

13

u/Ghi102 11d ago

No joke, XML has a few benefits. Like comments and versioning.

Still mind-blowing to me that JSON still has no official comments support

6

u/Blue_Moon_Lake 11d ago

The horror of XML is that you can make things ugly very quickly.

  • Mixed elements that aren't "properties"
  • Element having some properties as properties and some as children elements

Eg.

<ItemList>
    <FooItem property="foo"></Foo>
    <BarItem>
        <Property> bar </Property>
    </Bar>
    <QuxItem>
        <Property value="qux" />
    </Qux>
</ItemList>

4

u/Ghi102 11d ago

Mark Seeman has an interesting blog where he compares XML vs JSON and argues that XML is the superior data exchange format.

Even if you disagree (and especially if you've never touched XML), it's an interesting read. 

7

u/nimrag_is_coming 11d ago

I'm a big proponent for simple formats like ini for config and simple data. You can write a parser in about 20 minutes, and there's no reason you should have to do a whole load of JSON when all you need to do is match key value pairs. Easier to write, easier to read, easier for computer to parse

6

u/ynnnnaD 11d ago

I miss INI files, honestly. When they were popular was a magical time in coding.

6

u/bwmat 11d ago

Like others have said, there's value in the simplicity of INI

11

u/Keavon 11d ago

INI, also known as TOML, is good. Really good. More people should use TOML.

4

u/BSFGP_0001 11d ago

INI and TOML are differend formats

-1

u/Keavon 10d ago

Not really, in the sense that INI isn't a format while TOML is a particular specification for the variety of similar INI implementations. TOML is just the one spec for the lack of INI non-specs. For the common things, it's the same.

1

u/eNroNNie 11d ago

I agree on TOML for configs, but nobody uses it so I just use json for my API stuff and yml for static configs.

2

u/rjwut 11d ago

Granted, if I were forced to choose between YAML and XML, I'd probably go with YAML. Grudgingly.