{"id":120,"date":"2016-04-25T10:13:43","date_gmt":"2016-04-25T10:13:43","guid":{"rendered":"http:\/\/blog.qubekwest.com\/?p=120"},"modified":"2016-04-25T10:13:43","modified_gmt":"2016-04-25T10:13:43","slug":"code-audit","status":"publish","type":"post","link":"https:\/\/blog.qubekwest.com\/?p=120","title":{"rendered":"Code Audit"},"content":{"rendered":"<p>After a bit of working on things, I tried to write a little code that I just expected would work. \u00a0When what I tried didn&#8217;t exist yet on the other object, I got to thinking. \u00a0How many of the things that I just expect to be there are actually written? \u00a0This started a code audit that I initially hoped would be two or three days, but quickly turned into a two week long adventure. \u00a0This process was exactly as tedious and boring as you are probably imagining and involved several rather elaborate tables of check marks in my QubeKwest notebook.<\/p>\n<p>As it turns out, a lot of my objects were missing a lot of the things I wanted them to have, and some other ones actually had completely different ways of doing the same thing. \u00a0(For example, a clone method instead of a copy constructor.) \u00a0That meant coding things that were missing, recoding things that I felt were weird, removing things that should never have been there in the first place, and adding tests to cover all of the things that changed. \u00a0While I was working on the various audits I was performing, I came up with a few new patterns I wanted in place and added them to my notes. \u00a0I even had a few columns for whether or not the files had all the JavaDocs I wanted them to have.<\/p>\n<p>I&#8217;d like to say this was just a bit of &#8220;Hey, my Vector4 should have a static isEqual on it.&#8221; followed by coding it and calling it a day, but that&#8217;s not really how this process went at all. \u00a0Each time I&#8217;d bump into another thing that made me sad, I&#8217;d make another list with more check marks. \u00a0This in turn led me to wander into the code again from a different angle. \u00a0For example, once I&#8217;d added serialization to my math library, I realized that I originally wanted all of the functions to have both &#8220;static&#8221; and &#8220;with this&#8221; versions of all the math functions on all the objects, and that what I had was a bit of pot luck. \u00a0More check lists, more coding things, more writing tests to get code coverage back to where I want it. \u00a0This in turn inspired a test audit that made sure everything was tested correctly and where the tests themselves were named correctly (following the pattern I&#8217;d established anyway).<\/p>\n<p>In the end, after weeks of checking out the code, working on new bits, typing JavaDocs, and adding tests for things I didn&#8217;t even realize were missing, I think the math and data packages are in a much better place. \u00a0That makes me happy on a deep fundamentally nerdy level, even if the process of getting there was sort of terrible to have gone through.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a bit of working on things, I tried to write a little code that I just expected would work. \u00a0When what I tried didn&#8217;t exist yet on the other object, I got to thinking. \u00a0How many of the things that I just expect to be there are actually written? \u00a0This started a code audit &hellip; <a href=\"https:\/\/blog.qubekwest.com\/?p=120\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Code Audit<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":3,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":141,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions\/141"}],"wp:attachment":[{"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qubekwest.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}