{"id":362,"date":"2020-08-22T07:42:23","date_gmt":"2020-08-22T11:42:23","guid":{"rendered":"http:\/\/wfredk.com\/blog\/?p=362"},"modified":"2020-08-22T07:42:23","modified_gmt":"2020-08-22T11:42:23","slug":"on_prototype_code_development","status":"publish","type":"post","link":"https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development","title":{"rendered":"On &#8220;prototype&#8221; code development"},"content":{"rendered":"<div id=\"gmail-container\" class=\"gmail-style-scope gmail-gr-formatted-text\">\n<p class=\"gmail-style-scope gmail-gr-formatted-text\"><span class=\"gmail-style-scope gmail-gr-formatted-text gmail-x-scope gmail-gr-linked-text-0\"><span id=\"gmail-output\" class=\"gmail-style-scope gmail-gr-linked-text\">In many years of consulting, I&#8217;ve seen a lot of projects developed with the philosophy of &#8220;<span style=\"color: #ccffff;\">Don&#8217;t worry about [comments][readable code][proper variable names][documentation][error handling][optimization][<em>(your favorite corner to cut here)<\/em>] because this is just a prototype &#8211; we&#8217;ll fix those things when we write the production code.<\/span>&#8221; In <strong>100%<\/strong> of those cases, when the prototype was reasonably close to working, it got shipped: The &#8220;prototype&#8221; became the production code, errors, shortcomings and all. Maintenance, updates and improvements became nightmares, often leading to complete failure of what could have been a great product. Trying to avoid those problems feeds into my OCD tendencies, and when I see a comment like &#8220;we&#8217;ll write another [CR] to fix it&#8221; I tend to balk because <em>I know the rewrite will never happen<\/em>. Furthermore, when a future developer is called on to fix a bug or develop a new feature, they&#8217;re going to be &#8220;strongly&#8221; discouraged from making any changes beyond their immediate effort, even if renaming variables would make the code more readable when they discovered &#8220;flag&#8221; is &#8220;page_type&#8221; or &#8220;std&#8221; means &#8220;start_date&#8221; instead of &#8220;standard&#8221; etc. Having an understandable, well documented interface from the beginning is a <em><strong>LOT<\/strong><\/em> more important than making all of the internal variables recognizable. &#8220;Cosmetic changes&#8221; often look a lot less trivial when you realize that the lifetime cost of code maintenance is generally <em>ten times<\/em> what it cost for a program to be written initially.<\/span><\/span><\/p>\n<p class=\"gmail-style-scope gmail-gr-formatted-text\"><span class=\"gmail-style-scope gmail-gr-formatted-text gmail-x-scope gmail-gr-linked-text-0\"><span id=\"gmail-output\" class=\"gmail-style-scope gmail-gr-linked-text\">I recognize that I have to reign in my OCD to let development proceed. However, when a developer asks someone to review their code, they need to recognize the reviewer is looking at it from a different perspective than they are. If a reviewer doesn&#8217;t understand something, it could either be an error or a misunderstanding. When a misunderstanding is encountered, commenting on a change request doesn&#8217;t help the next person <em>reading the code<\/em>, and adding a comment to the code at this point isn&#8217;t a lot of effort. It will, though, make the code more maintainable &#8211; it reduces the maintenance cost. Also, if a native English speaker hands a foreign born developer a well written docstring that clarifies a point of confusion, it&#8217;s not <em>just courteous<\/em> to use it: You&#8217;re not going to break anything by putting the brakes on for a moment and push one more patch set.<\/span><\/span><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div id=\"spreadx\">&nbsp;<a href=\"http:\/\/digg.com\/submit?phase=2&url=https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/digg.gif\" alt=\"Digg\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/facebook.gif\" alt=\"Facebook\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/www.stumbleupon.com\/submit?url=https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development&title=On+%26%238220%3Bprototype%26%238221%3B+code+development\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/stumble.gif\" alt=\"StumbleUpon\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/technorati.com\/faves?add=https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/technorati.gif\" alt=\"Technorati\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/del.icio.us\/post?url=https:\/\/wfredk.com\/blog\/2020082207\/on_prototype_code_development&title=On+%26%238220%3Bprototype%26%238221%3B+code+development\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/delicious.gif\" alt=\"Deli.cio.us\" border=\"0\" \/><\/a>&nbsp;<\/div>","protected":false},"excerpt":{"rendered":"<p>In many years of consulting, I&#8217;ve seen a lot of projects developed with the philosophy of &#8220;Don&#8217;t worry about [comments][readable code][proper variable names][documentation][error handling][optimization][(your favorite corner to cut here)] because this is just a prototype &#8211; we&#8217;ll fix those things when we write the production code.&#8221; In 100% of those cases, when the prototype was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,28],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-philosophy","category-software-development"],"_links":{"self":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":2,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}