I have been playing with the following idea: commonly when different major versions of a product are maintained in parallel one uses different branches within a version control system to develop them. In theory though one could use feature macros (written from a C/C++ point of view, but the idea should be portable) to enable or disable particular features based on the version which is being built. The idea behind this is that normally one will want to back-port fixes and improvements to older versions unless one has a specific reason not to (e.g. too dangerous, headline feature for a particular version). However, these back-ports are often done in a rather haphazard way, resulting in unintended subtle differences between versions or forgotten fixes in certain versions. While the feature macro approach would not be a silver bullet by any means, it might improve the level of stability which one would achieve with a given amount of testing. I would also expect it to improve code structure by forcing cleaner separation of different features.
So the question: does anyone know of real-world data about this or similar approaches?
Aucun commentaire:
Enregistrer un commentaire