Using “new” suffix for versioning is an antipattern

A typical story: your project has an internal component named xyz, you develop a new version and name it, of course, xyz_new.
Is it a good idea? I don’t think so.

First of all, it’s a one shot thing. If you have a second version, there probably going to be a third one. What will it be named? xyz_new_new? xyz_newer? xyz_really_new?

Second of all, “new” is time sensitive. Will “new” look proper when the component is 10 years old? “Pont Neuf” (i.e. “New Bridge”) is the oldest bridge in Paris. There are a few cities around the world literally named “New City” (Napoli in Italy, Nablus in Palestine, Novgorod in Russia) which are many centuries old.

Similar advice is given about other suffixes like “Ex”, It is much better to give new name a numeric index like xyz2 or xyz_v2.

Reference: .NET General Naming Conventions:

❌ DO NOT use the "Ex" (or a similar) suffix for an identifier to distinguish it from an earlier version of the same API.

Leave a Reply

Your email address will not be published. Required fields are marked *