{"id":191,"date":"2004-10-11T08:36:38","date_gmt":"2004-10-11T14:36:38","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=191"},"modified":"2004-10-11T08:36:38","modified_gmt":"2004-10-11T14:36:38","slug":"coding-standards","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/191","title":{"rendered":"Coding Standards"},"content":{"rendered":"<p>We&#8217;ve all been caught up in the religious war of coding standards.  Whether it&#8217;s &#8216;tab vs spaces&#8217; or &#8216;3 spaces vs 4 spaces&#8217; or &#8216;curly brace on same line as if clause or curly brace on line below if clause&#8217;, these arguments can take up a significant amount of time on a project.  Ken Arnold has an interesting post where <a href='http:\/\/www.artima.com\/weblogs\/viewpost.jsp?thread=74230'>he recommends that coding standards be integrated into the language specification, and enforced by the compiler<\/a>.  His reasons:<\/p>\n<p>1.  There&#8217;s no real productivity difference between one coding style and another.<\/p>\n<p>2.  There&#8217;s real productivity lost in setting up pretty printers, re-formatting code manually, and arguing about the better style.<\/p>\n<p>3.  If programmers have latitude, they&#8217;ll use it.  (See <a href='http:\/\/www.perl.com'>perl<\/a>.)<\/p>\n<p>So, take away the freedom of programmers to format their code in a non standard manner.  Make coding style part of the compiler&#8211;not as a warning though (as <a href='http:\/\/mindview.net\/WebLog\/log-0057'>Bruce Eckel says &#8220;when you discover you can ignore them [warnings], you do&#8221;<\/a>)&#8211;actually have the compiler error out if the formatting is incorrect.<\/p>\n<p>Sure, I&#8217;d wail along with the rest of the coding community, for a while.  But then I&#8217;d adjust, especially if the tools were there.  And I&#8217;d probably be more productive.  Talk about tough love.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve all been caught up in the religious war of coding standards. Whether it&#8217;s &#8216;tab vs spaces&#8217; or &#8216;3 spaces vs 4 spaces&#8217; or &#8216;curly brace on same line as [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}