2023 May Be A Year Of TOML

Aside of JSON and XML there is a config format with increasing adoption. TOML may be something you’ll like.

Tom Smykowski

--

XML

Like every .NET developer for years I’ve worked with XML files for config and serializing data.

I like XML because it’s very verbose and it’s hard to break it. To a point it’s also diffucult to edit it. As a transfer format it’s nice and gives the assurance the receiving end will either fail than read it bad.

But it comes also with some downsides. For example it’s extremely heavy, a disadventage thst makes you question of 100MB of raw data should end up as 1GB on a storage unit, accounting also to a heavy memory usage during parsing. Something new parsers are deal with quite good.

JSON

On the other side of the spectrum is JSON, a format implicite of frontend, and especially web development.

JSON is light, it’s easy to stringify data, and parse them with JavaScript. But when you start to work with JSON config files you immediately notice that editing a JSON is somehow troublesome.

Don’t forget to subscribe!

Keeping proper setup of curly brackets becomes an important part of the job, and reading bigger JSON files can be troubling. It’s sometimes hard to recognize on whst level of the nesting you are.

Of course it depends on how you use JSON and for rather flat files it’s perfectly fine, like every file format.

YAML

In the devops world there’s other format that’s quite popular. It’s YAML. Even the main page seems to written in YAML. Something that gives both adorable and not-fun-at-all vibe:

I don’t feel like the page is easy to read in this format. But with some normal data YAML looks quite ok and can sound familiar for Python coders:

--

--

Tom Smykowski

I will be able to write the next article when 9 people will become a member. Become a member now: https://medium.com/membership/@tomaszs2