{"id":942,"date":"2015-01-26T22:26:44","date_gmt":"2015-01-27T06:26:44","guid":{"rendered":"http:\/\/www.elbeno.com\/blog\/?p=942"},"modified":"2015-01-26T22:47:42","modified_gmt":"2015-01-27T06:47:42","slug":"holy-wars","status":"publish","type":"post","link":"https:\/\/www.elbeno.com\/blog\/?p=942","title":{"rendered":"Holy Wars"},"content":{"rendered":"<p>All right, I have some opinions. Here are the definitive answers to the three most important dilemmas facing programmers today \ud83d\ude42<\/p>\n<p>* Static typing vs Dynamic typing<\/p>\n<p><em>Static typing<\/em>. I suppose dynamic types are OK if you&#8217;re hacking together a small tool. But static (strong, preferably HM-inferred) typing allows you to reason about your program much more powerfully. Correctness by construction, enforced by the compiler, is a wonderful thing. I used to write a lot of unit tests; now I write many fewer, and instead I write my code closer to the ideal of &#8220;if it compiles, it runs correctly&#8221;.<\/p>\n<p>* Spaces vs Tabs<\/p>\n<p><em>Spaces<\/em>. The traditional argument for tabs is that they let everyone see the file the way they want. Except, in today&#8217;s world of reviewing code on the web, they don&#8217;t. People don&#8217;t get to control all the ways they see a file (eg look at github diffs).<\/p>\n<p>So spaces are the only way to provide consistent, aligned code. File size isn&#8217;t a consideration: one texture can dwarf all the source code a single programmer produces in a year. Number of keystrokes or ease of cursor motion isn&#8217;t a consideration: use a real editor, please. (Hint: hitting the tab key shouldn&#8217;t insert a tab character.) Which brings me nicely to&#8230;<\/p>\n<p>* Emacs vs Vi(m)<\/p>\n<p><em>Emacs<\/em>. Now don&#8217;t get me wrong; vi is a great editor. But emacs isn&#8217;t an editor, it&#8217;s a lisp OS. As such, it&#8217;s a great <em>everything<\/em> (including a great environment in which to implement vi). That said, both are light years ahead of anything else. What do you mean, your editor can&#8217;t delete trailing whitespace\/edit files over ssh\/show &#8216;git blame&#8217; inline\/do &lt;other thing that emacs &#038; vi have done for decades&gt;?<\/p>\n<p>Also, org-mode. My case rests.<\/p>\n<p>&#8212;<\/p>\n<p>In case anyone think this is a serious rant, I do actually work without complaint (mostly) in code that uses tabs, and even sometimes in dynamic languages. So it&#8217;s not too serious. Except for the emacs\/vi vs everything else part \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All right, I have some opinions. Here are the definitive answers to the three most important dilemmas facing programmers today \ud83d\ude42 * Static typing vs Dynamic typing Static typing. I suppose dynamic types are OK if you&#8217;re hacking together a small tool. But static (strong, preferably HM-inferred) typing allows you&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-942","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=942"}],"version-history":[{"count":7,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/942\/revisions"}],"predecessor-version":[{"id":949,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/942\/revisions\/949"}],"wp:attachment":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}