Last week, I thought -version- was a tool for backward compatibility and forward compatibility. But it's not, is it? It's a tool for forward compatibility only.
Let me explain. I am using Stata 18, but writing -version 14.0- at the top of my do-files, under the assumption that my colleagues who use Stata 14 will get the same results I get with Stata 18. This mostly works. But an issue arose when I used the system variable _r_ub, and it didn't show up for a colleague on a previous version of Stata.
How should I consider the fact that _r_ub is available in Stata 18, despite specifying -version 14.0-?
Clearly this isn't the only way that -version- is used in practice. In particular, I think most ado authors deliberately specify "old" versions despite authoring on "new" versions, which is conceptually not so different from my own use-case.
So I have two questions:
Let me explain. I am using Stata 18, but writing -version 14.0- at the top of my do-files, under the assumption that my colleagues who use Stata 14 will get the same results I get with Stata 18. This mostly works. But an issue arose when I used the system variable _r_ub, and it didn't show up for a colleague on a previous version of Stata.
How should I consider the fact that _r_ub is available in Stata 18, despite specifying -version 14.0-?
- A bug?
- Not exactly a bug, but an undesirable side-effect, which the developers can minimize but will never stamp out completely?
- Not at all a bug; working as intended?
Clearly this isn't the only way that -version- is used in practice. In particular, I think most ado authors deliberately specify "old" versions despite authoring on "new" versions, which is conceptually not so different from my own use-case.
So I have two questions:
- Do I understand -version- correctly now? That is, is it correct that -version- makes no guarantees of backwards compatibility?
- What are best practices for authoring do-files compatible with older versions of Stata? The two main alternatives I see are to actually use an old version of Stata, or to [mis]use -version- and simply be vigilant for the occasional neologism that -version- permits.
Comment