{"id":1527,"date":"2022-12-02T12:49:31","date_gmt":"2022-12-02T19:49:31","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=1527"},"modified":"2022-12-02T12:49:31","modified_gmt":"2022-12-02T19:49:31","slug":"fixing-code-by-not-touching-it","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2022\/12\/02\/fixing-code-by-not-touching-it\/","title":{"rendered":"Fixing code by not touching it"},"content":{"rendered":"\n<p>The other day I was helping a friend with some code that worked fine in several versions of Xojo but then in a newer one wouldn&#8217;t compile<\/p>\n\n\n\n<p>Seems he found a<a href=\"https:\/\/tracker.xojo.com\/xojoinc\/xojo\/-\/issues\/71075\"> compiler regression<\/a> Whether this _should_ have been caught by regression tests etc is an entirely different question. <\/p>\n\n\n\n<p>It exists. And now his large project doesn&#8217;t compile.<\/p>\n\n\n\n<p>The code this affects is old and has worked for many years.<br>And he&#8217;d rather NOT have to alter all of it to fix the issue.<\/p>\n\n\n\n<p>Since the code in question is in a subclass he was not looking forward to making significant changes to it and having to retest all his changes<\/p>\n\n\n\n<p>So how can he fix this compiler issue and NOT have to touch all the code that suddenly doesnt compile ?<\/p>\n\n\n\n<p>There are several options<\/p>\n\n\n\n<p>Of course he could &#8220;fix&#8221; the code in the class directly &#8211; not something he relished<\/p>\n\n\n\n<p>Another option is to just NOT use a new version of Xojo that breaks things this way &#8211; not a great option if he wants to support Ventura &amp; newer<\/p>\n\n\n\n<p>There is at least 1 more that is fairly simple, testable, and does fix this without actually modifying the code in the original class \ud83d\ude42<\/p>\n\n\n\n<p>I&#8217;ll let you noodle on that until tomorrow.<\/p>\n\n\n\n<p><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day I was helping a friend with some code that worked fine in several versions of Xojo but then in a newer one wouldn&#8217;t compile Seems he found a compiler regression Whether this _should_ have been caught by regression tests etc is an entirely different question. It exists. And now his large project &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2022\/12\/02\/fixing-code-by-not-touching-it\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing code by not touching it&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[27,6,3],"class_list":["post-1527","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-advanced-techniques","tag-tips","tag-xojo"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=1527"}],"version-history":[{"count":2,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1527\/revisions"}],"predecessor-version":[{"id":1529,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1527\/revisions\/1529"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=1527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=1527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=1527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}