LWN.net Logo

This is the "right kind of version number"

This is the "right kind of version number"

Posted Sep 26, 2013 1:26 UTC (Thu) by davecb (subscriber, #1574)
Parent article: A perf ABI fix

Literal version numbers are what most people use, but they need not be that simple-minded. The pre-IP ARPANET also used a one-bit version number, according to an old colleague.

This is also an elegant solution to the "how do I introduce versioning" problem, exactly as was faced by the RCS developers when they first had to introduce an incompatible change. Something that's at least physically there (albeit not always "logically" there) gets used as the indicator, and everything thereafter can have as wide a version number as it needs.

If this structure only changes every 10-20 years, a one bit width will probably do for all time (;-))

See also Paul Stachour's paper at http://cacm.acm.org/magazines/2009/11/48444-you-dont-know... for a more conventional worked example.

--dave (who edited Paul's paper) c-b


(Log in to post comments)

This is the "right kind of version number"

Posted Sep 26, 2013 11:11 UTC (Thu) by jnareb (subscriber, #46500) [Link]

There was similar situation that Git DVCS developers faced when adding new features to its network protocol. The first version was not designed with extendability in mind, but because exchange was done with pkt-lines, with length as part of payload but original parsing stopped at NUL ("\0") character they have shoe-horned information about extensions ('capabilities', this time in extendable space separated list of capabilites format) after NUL character; old clients skip capabilities list, new clients parse it and reply which they want to use.

Backward compatibility was preserved with a very few exception for server-client transfer thorough whole existence of Git.

This is the "right kind of version number"

Posted Sep 26, 2013 11:53 UTC (Thu) by davecb (subscriber, #1574) [Link]

An elegant approach!

It's a lot easier in modern programming languages, where a new variant can be intruduced by adding a parameter. For common cases, this can hide the ened for versioning and future-proofing from the developer.

Unless, of course, you're making a change from an absolute date to a relative one, both expressed as an integer (:-()

--dave

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds