|
|
|
|
|
by catiopatio
996 days ago
|
|
You stick a magic number and a version number at the top of the file and call it done. It’s trivial and buys you a great deal. The magic means it’s possible to identify the file type. Maybe you’ll add a tool later that operates on multiple types of files. The version means you can evolve the contents in non-backwards-compatible ways, while maintaining the ability to read/parse the old version. It’s a pain in the ass to add a magic or version number later; there’s a reason why nearly every file format
on the planet has both. |
|
XML
JSON
YML
TOML