
{"id":5381,"date":"2025-11-13T23:52:44","date_gmt":"2025-11-14T04:52:44","guid":{"rendered":"https:\/\/ikriv.com\/blog\/?p=5381"},"modified":"2025-11-13T23:52:44","modified_gmt":"2025-11-14T04:52:44","slug":"using-new-suffix-for-versioning-is-an-antipattern","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=5381","title":{"rendered":"Using &#8220;new&#8221; suffix for versioning is an antipattern"},"content":{"rendered":"<p>A typical story: your project has an internal component named <code>xyz<\/code>, you develop a new version and name it, of course, <code>xyz_new<\/code>.<br \/>\nIs it a good idea? I don&#8217;t think so.<\/p>\n<p>First of all, it&#8217;s a one shot thing. If you have a second version, there probably going to be a third one. What will it be named? <code>xyz_new_new<\/code>? <code>xyz_newer<\/code>? <code>xyz_really_new<\/code>?<\/p>\n<p>Second of all, &#8220;new&#8221; is time sensitive. Will &#8220;new&#8221; look proper when the component is 10 years old? &#8220;Pont Neuf&#8221; (i.e. &#8220;New Bridge&#8221;) is the oldest bridge in Paris. There are a few cities around the world literally named &#8220;New City&#8221; (Napoli in Italy, Nablus in Palestine, Novgorod in Russia) which are many centuries old.<\/p>\n<p>Similar advice is given about other suffixes like &#8220;Ex&#8221;, It is much better to give new name a numeric index like <code>xyz2<\/code> or <code>xyz_v2<\/code>.<\/p>\n<p>Reference: <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/design-guidelines\/general-naming-conventions\">.NET General Naming Conventions<\/a>:<\/p>\n<p><code>\u274c DO NOT use the \"Ex\" (or a similar) suffix for an identifier to distinguish it from an earlier version of the same API.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t think <a href=\"https:\/\/ikriv.com\/blog\/?p=5381\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[1],"tags":[],"class_list":["entry","author-ikriv","post-5381","post","type-post","status-publish","format-standard","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5381"}],"version-history":[{"count":2,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5381\/revisions"}],"predecessor-version":[{"id":5383,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5381\/revisions\/5383"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}