Thank you for your donations!   Download the book!   Public source code repository   Join the group!

Counting (beans) correctly

Sometimes, one would need to refactor, redo, or redesign feature, or whole component. Usually, those things starts with removing offending items, before development can take different route. Now, problem is that most versioning schemes don't have a way to encode project status by lowering version, but this is what is actually happening. Version numbers are collectively meant to only go up, not down.

How to solve this? By adding another ever-increasing number, of course! Jokes aside, that's just what I did. Mostly, it can be ignored, it's just a humble integer, tucked neatly at the end of a version train, slowly incrementing over time. 

Counter actually is the most significant number when comparing versions, i.e. 
<major>.<minor>.<feature>.<commit>:<count>
actually is
<count>:<major>.<minor>.<feature>.<commit>.
And so, versions of a refactored development could look like so:
0.2.3.4:56 < 0.3.4.5:67 < 0.7.9.23:456
< 0.2.3.4:457 < 0.3.4.5:567
.

Reasons why counter is written at the last place in a version is because:

  • it's the fastest changing number
  • most of the time it's not useful
  • people, when speak of a version, think of arbitrary number(s) given by developers, and not a commit counter

No comments:

Post a Comment