top | item 37583102

(no title)

tetrep | 2 years ago

If you want to future proof it you need to version it. It sounds like you're trying to pack many things into a single file, so having the first few bits of the file represent a version allows you to use fixed length integers without fear of them being too small (in the future). You can reserve the "last" version for varint if you truly need it.

In general, I find adding versions to things allows for much more graceful future redesigns and that is, IMO, invaluable if you're concerned about longevity and are not confident in your ability to perfectly design something for the indefinite future.

discuss

order

NavinF|2 years ago

I don't see the point. As soon as you bump the version number, old versions of the software will refuse to read newer files. So you might as well use a new format and file extension for the newer files. Of course the new software will read both formats.

The way protobufs handles versioning (old software ignores unknown fields) is far superior and realistically everyone uses 64 bit fixed length sizes everywhere

paulddraper|2 years ago

YAGNI

The idea is so simple that any change would be a misfeature.

stravant|2 years ago

I'm a big YAGNI proponent but format version numbers are not something I would dare to YAGNI.