writing

How many data types does it take to change a lightbulb?

What do CSV, INI, XML, JSON, YAML, and TOML have in common?

All are human-readable formats which can encode complex data of various types (that might be arguable in the case of CSV and INI, but let’s give them a pass for the sake of this argument).

Suppose we were to design a new format, for whatever reason. How many data types should it support? How many data types does a format support?

To help answer this philosophical question let’s see what the short answer is for each of the above.

How many data types does CSV support?

The first rule of CSV is: you do not talk about data types.

How many data types does INI support?

THE FIRST RULE OF INI IS: YOU DO NOT TALK ABOUT DATA TYPES!

How many data types does XML support?

It’s not that simple, okay?

How many data types does JSON support?

About six. Six or seven.

How many data types does YAML support?

At least as many as JSON!

How many data types does TOML support?

Almost as many as JSON plus a few more!

Conclusion

Hm, looks like there is no short answer. Let’s sleep on it and try again tomorrow.


© 2022 Darius J Chuck