{"id":1199,"date":"2010-04-14T11:32:35","date_gmt":"2010-04-14T01:32:35","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/?p=1199"},"modified":"2010-04-14T11:32:35","modified_gmt":"2010-04-14T01:32:35","slug":"is-the-compiler-a-distraction","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2010\/04\/14\/is-the-compiler-a-distraction\/","title":{"rendered":"Is the Compiler a Distraction?"},"content":{"rendered":"<p>Here is a thought that was triggered while considering the <a href=\"http:\/\/www.somethinkodd.com\/oddthinking\/2010\/04\/14\/theres-only-one-thing-worse-than-having-unit-tests\/\">impact of unit tests<\/a> in my last post.<\/p>\n<p>Context switches for the human brain are expensive &#8211; not only does it take time to remember what you were thinking before, but they offer an opportunity for distraction and to not return to the primary task.<\/p>\n<p>Delays waiting for the computer offer a forced context switch. <\/p>\n<p>This comes in many flavours, and can probably explain more behaviour than I had previously expected. For example, <a href=\"http:\/\/www.somethinkodd.com\/oddthinking\/2006\/11\/10\/efficiency-of-banner-pages\/\">abandoned print-outs<\/a> can be seen as a classic case of a forced wait, triggering a context switch and a distraction.<\/p>\n<p>Large compilation time produces a common delay in the the workflow of a software developer. Perhaps scripting languages, such as Python, are (perceived as?) more productive than compiled languages <em>not<\/em> because loose typing unshackles the developer&#8217;s creativity, but because there are no large compilation delays in the workflow. Sure, they may run slower, but that slowness is typically spread out, never being boring enough to trigger a context switch.<\/p>\n<p>I have often noticed that, in PHP development, the download of edited code to the test server takes up the same role as compilation in my workflow; just slow enough to facilitate distraction, but without the benefits of the <a href=\"http:\/\/twitter.com\/randomphrase\/status\/11824147303\">forced poor man&#8217;s unit-test<\/a>. I don&#8217;t perceive PHP development as particularly productive, but that may also due to my dislike of the poor language design. (To be fair, this is an issue with web-development, and the choice of PHP is theoretically orthogonal. In practice, I wouldn&#8217;t touch PHP for any other purpose, where I wasn&#8217;t forced to use it.)<\/p>\n<p>Unit tests serve the same barrier. Sure they don&#8217;t need to be run as commonly as a compiler or ftp\/rsync\/<a href=\"http:\/\/www.somethinkodd.com\/oddthinking\/2007\/04\/10\/installing-in-unison\/\">unison<\/a>, but they offer that speed bump in the workflow.  No &#8211; speed bump is the wrong analogy. Traffic lights. Not only do they slow you down, but they offer you the opportunity to take a wrong turn while you are waiting.<\/p>\n<div class=\"aside\">This is not an attack on compiled languages, scripted languages, PHP, web-site development, unit tests or traffic lights. It is merely an observation about where my easily-distracted brain gets tripped up when trying to be productive&#8230; Okay, it really is an attack on PHP, but that wasn&#8217;t the main point.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Is the real problem with compilers (and web-development and unit-tests) that they force a context-switch in the middle of the development process?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[21,34,27],"tags":[344,345,347,69,346],"class_list":["post-1199","post","type-post","status-publish","format-standard","hentry","category-observation","category-software-development","category-thoughts-from-the-shower","tag-brain","tag-distractions","tag-productivity","tag-software","tag-unit-tests"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=1199"}],"version-history":[{"count":3,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1199\/revisions"}],"predecessor-version":[{"id":1202,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1199\/revisions\/1202"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}