<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Absolutely No Machete Juggling</title>
	<atom:link href="http://www.nomachetejuggling.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nomachetejuggling.com</link>
	<description>Rod Hilton&#039;s rants about stuff he cares about way too much.</description>
	<lastBuildDate>Fri, 03 Feb 2012 02:27:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Computer Science and Telescopes</title>
		<link>http://www.nomachetejuggling.com/2012/02/02/computer-science-and-telescopes/</link>
		<comments>http://www.nomachetejuggling.com/2012/02/02/computer-science-and-telescopes/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 02:27:06 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[academia]]></category>
		<category><![CDATA[academics]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1812</guid>
		<description><![CDATA[Whenever there is a discussion about what Computer Science is and what it is not, it is a near-certainty that a particular quote will soon be used. Computer science is no more about computers than astronomy is about telescopes. This quote, attributed to the brilliant Edsger Dijkstra is such a perfect little summary of what [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever there is a discussion about what Computer Science is and what it is not, it is a near-certainty that a particular quote will soon be used.</p>
<blockquote><p>
Computer science is no more about computers than astronomy is about telescopes.
</p></blockquote>
<p>This quote, attributed to the brilliant <a href="http://en.wikipedia.org/wiki/Edsger_W._Dijkstra">Edsger Dijkstra</a> is such a perfect little summary of what Computer Science is, and it explains so much about the field in a very short space, it&#8217;s ideal for explaining CS to those outside of the field.</p>
<p>The problem is, <strong>it&#8217;s bullshit</strong>.</p>
<p><span id="more-1812"></span></p>
<p>This quote is an attempt to explain that Computer Science is about <i>Computation</i>, not <i>Computers</i>.  It&#8217;s about algorithms, complexity, and so on; those whirring boxes under our desks are just TOOLS for studying the real SCIENCE.  I&#8217;ve been guilty of using this quote myself on more than one occasion, largely as a way to make my degree sound more academically pure (harder) somehow.</p>
<p>If the quote were about &#8220;purely theoretical computer science&#8221; then perhaps I could agree.  Indeed, Alan Turing created the foundation of computer science well before computers existed, and the Church-Turing thesis suggests that &#8220;computer science&#8221; can be studied with purely theoretical models of computation such as Turing machines, or with just $$\lambda$$-calculus.  But anyone with a CS degree will tell you that turing machines and calculus generally only come up in classes with the word &#8220;theory&#8221; or &#8220;model&#8221; in the title.  Whether originally intended or not, Dijkstra&#8217;s quotation is generally used with regard to the entirety of the <strong>modern-day Computer Science college degree</strong>.  And in that context, the quote is nonsense.</p>
<p><img src="http://www.nomachetejuggling.com/files/cs.jpg" alt="" title="CS" width="300" height="225" class="alignright size-full wp-image-1818" /></p>
<p>When you major in Astronomy, you take courses about the galaxy, physics, gravity, cosmology, black holes, and so forth, but not telescope construction, telescope optimization, historical telescope engineering, and lens alignment.</p>
<p>A typical Computer Science degree will include computer architecture, compiler design, compiler construction, networking, and operating systems.  These are courses that are unquestionably about <strong>actual computers</strong>.  Sure, they are informed by the theoretical material, but ultimately the thing being studied is an actual machine.  Go find a CS major in an architecture class, studying the way that processes are laid out in memory and how to optimize memory allocations to be in multiples of the cache size for memory optimization, and tell them that their degree has nothing to do with computers.</p>
<p>I&#8217;ve also often heard &#8220;Computer Science is a branch of mathematics.&#8221;  This, too, is nonsense.  Computer Science uses a lot of math, but it&#8217;s no more a <b>subset</b> of math than physics is a subset of calculus.  You could take every single math course offered at every single school in the world and never wind up learning anything about how file systems are implemented.  It&#8217;s not a subset.  Go ask a mathematician if CS is a branch of math.</p>
<p>Despite the constant drive to figure out which thing Computer Science is most like, the truth is that no analogy is good for Computer Science.  Computer Science isn&#8217;t <b>like</b> any other discipline.  It&#8217;s a weird hybrid between science, mathematics, and engineering.  It&#8217;s all of those things at once, and none individually.</p>
<p>When I was an undergrad, my school had 3 divisions under their <a href="http://www.rochester.edu/college/sas/">College of Arts and Sciences</a>: humanities, social sciences, and natural sciences.  Computer Science was categorized as a natural science.  A few years after I graduated, the major was moved not only out of that category, but <strong>out of that entire school</strong>, and into the <a href="http://www.hajim.rochester.edu/">School of Engineering</a>.  It went from being considered a science to being considered engineering.  I think it&#8217;s bizarre that so many people try to claim they can explain what Computer Science is with a 12 word pithy quote when universities can&#8217;t even seem to settle on it.</p>
<div id="attachment_1841" class="wp-caption alignleft" style="width: 310px"><img src="http://www.nomachetejuggling.com/files/pompous-e1328235145491-300x244.png" alt="" title="Asshole" width="300" height="244" class="size-medium wp-image-1841" /><p class="wp-caption-text">&quot;Computers, pish-posh! Naturally I majored in CS because of my childhood passion for the halting problem!&quot;</p></div>
<p>I respect Dijkstra immensely, and this quote may be true of theoretical computer science, or even CS within academia, but it&#8217;s not based on what a typical Computer Science major will study.  I can understand using this phrase as a way to avoid providing technical support and virus removal services to friends and family, but in terms of actually understanding the nature of the degree, I think it&#8217;s quite unhelpful. </p>
<p>When high school students post to various forums asking about CS, expressing interest in computers and programming, inevitably some pompous jerk will roll his or her virtual eyes and explain that CS has as much to do with computers as astronmy does with telescopes.  I think someone who truly has that view of Computer Science has about as good an understanding of the degree as the people who &#8220;just want to make games&#8221;.</p>
<p>Computer Science isn&#8217;t really a natural science, but it&#8217;s also not really a math, nor is it really engineering.  <strong>Computer Science isn&#8217;t like anything, it&#8217;s like Computer Science.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2012/02/02/computer-science-and-telescopes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fall 2011 Semester In Review</title>
		<link>http://www.nomachetejuggling.com/2011/12/21/fall-2011-semester-in-review/</link>
		<comments>http://www.nomachetejuggling.com/2011/12/21/fall-2011-semester-in-review/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:23:39 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[semester]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1726</guid>
		<description><![CDATA[In August, I started graduate school at the University of Colorado at Denver, joining their PhD program in Computer Science and Information Systems with a focus on Theory and Algorithms. This return to school was the first time since I graduated from the University of Rochester that I attended actual classes on a campus (my [...]]]></description>
			<content:encoded><![CDATA[<p>In August, I started graduate school at the <a href="http://www.ucdenver.edu/pages/ucdwelcomepage.aspx">University of Colorado at Denver</a>, joining their <a href="http://www.ucdenver.edu/academics/colleges/Engineering/Programs/Computer-Science-and-Engineering/DegreePrograms/DoctorPhilosophy/Pages/PhDComputerScienceInformationSystems.aspx">PhD program in Computer Science and Information Systems</a> with a focus on Theory and Algorithms.</p>
<p>This return to school was the first time since I graduated from the <a href="http://www.rochester.edu/">University of Rochester</a> that I attended actual classes on a campus (my Master&#8217;s program was entirely distance learning).  I wanted to record some of my thoughts about returning to school, since it&#8217;s been such an adjustment for me.</p>
<h1 id="toc-university-of-colorado-at-denver">University of Colorado at Denver</h1>
<p>The University of Colorado at Denver turned out to be exactly the kind of school I wanted.  </p>
<p><img src="http://www.nomachetejuggling.com/files/ucd-300x199.jpg" alt="" title="UCD Auraria Campus" width="300" height="199" class="alignright size-medium wp-image-1736" /></p>
<p>The University of Rochester was a great school, considered to be one of the &#8220;<a href="http://www.rochester.edu/news/new_ivy.html">New Ivy</a>&#8221; institutions.  The Computer Science program was very intensive there, and I was barely able to survive a few of my classes.  This was good for me as an undergrad &#8211; that was the right time in my life for an extremely intensive program, since I was in school full-time and focused on nothing else.  These days, however, I&#8217;m a full-time Software Engineer professionally, and I didn&#8217;t want to be part of such an intense program for graduate school.  I went back to grad school for fun, not for my career, and I wanted a program that would not burn me out due to difficulty.  Often I found undergrad classes so difficult that I was unable to comprehend some material, leaving me to feel lost, like I<strong> was missing out on interesting stuff because I couldn&#8217;t understand it before moving on</strong>.  I wasn&#8217;t interested in that kind of experience.</p>
<p>My master&#8217;s program with <a href="http://www.regis.edu/">Regis University</a>, on the other hand, was too far at the opposite end of the spectrum.  Since it was online and largely self-taught, I didn&#8217;t have much interaction with academics, professors, or even other students.  Often I wouldn&#8217;t bother doing the readings, and there were very few actual assignments (usually just a few projects per course).  In short, I felt like Regis was <strong>too easy</strong>, and I was often bored while attending.  I really enjoyed my thesis work, but the actual courses were so low-key that I was able to get straight A&#8217;s without really focusing on school, which reminded me way too much of high school.</p>
<p>I wanted something that would challenge me enough to keep me engaged, but not so challenging as to frustrate me.  I wanted actual lectures, homeworks, and exams, but I didn&#8217;t want them to be so difficult that I felt lost with the material.  <strong>This is precisely what I found at the University of Colorado at Denver.</strong></p>
<p><span id="more-1726"></span></p>
<p>The material was thorough, but the more difficult topics were always taught at a slightly slower pace, and the professors have been great about making sure their students understand.  There were definitely some frustrating nights doing difficult homeworks, but I was always able to correctly solve the problems with enough time and effort (as compared with undergrad, where no amount of time would have helped me with some assignments).  It was exactly the right level of challenge &#8211; enough that I knew it felt like a challenge, but never enough that I couldn&#8217;t find the solution.  <strong>Completing homeworks was intensely satisfying.</strong></p>
<p>If I had applied the same level of effort to UCD that I had applied to Regis, I would have failed out.  But applying the same level of effort that I applied at Rochester yielded me two A&#8217;s, rather than the B&#8217;s and C&#8217;s I got as an undergrad.  It was <em>perfect</em>.</p>
<h1 id="toc-campus">Campus</h1>
<p>Like I mentioned, this was the first time I was back on an actual campus in seven years.  I worried I would feel old and out of place.  As it turns out, the UCD physical campus is shared between UCD, the <a href="http://www.mscd.edu/">Metropolitan State of Denver</a>, and the <a href="http://www.ccd.edu/">Community College of Denver</a>.  As a result, the diversity of people on campus helped me feel completely at-ease.  I definitely wasn&#8217;t part of the younger crowd of undergrad college kids (wearing what is apparently a nationwide school uniform of &#8220;skinny jeans, boots, North Face jackets, and huge sunglasses&#8221;), but I wasn&#8217;t part of the older &#8220;I&#8217;m-changing-careers&#8221; crowd either.  It felt just about right, and I felt about the same age as the other students in my graduate courses.</p>
<p><img src="http://www.nomachetejuggling.com/files/univ-300x185.jpg" alt="" title="univ" width="300" height="185" class="alignleft size-medium wp-image-1741" /></p>
<p>I really enjoyed going to campus and attending classes.  Both classes were taught in a single building, so any time I was on campus I was in that building, save for a few rare instances of grabbing lunch at the food court.  I&#8217;m really glad I lived on campus as an undergrad because of the socialization doing so provided, but I went back to grad school exclusively for education, so the lack of social aspects worked well for me.  I probably wouldn&#8217;t recommend UCD to young undergrads, but it&#8217;s great for commuters and grad students.</p>
<p>My classroom building is a ten-minute walk from where I work (and the Computer Science department might soon move into a closer building).  My employer has been great about letting me leave work to attend class, and it&#8217;s so conveniently close that it&#8217;s been a real pleasure.  I&#8217;m pretty sure that my classes are even closer to my office than my classes were to my dorm room as an undergrad.</p>
<h1 id="toc-classes">Classes</h1>
<h2 id="toc-graduate-algorithms">Graduate Algorithms</h2>
<p>Testbook: <a href="http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844">Introduction to Algorithms, 3rd ed.</a></p>
<p>My first class, taught by <a href="http://carbon.ucdenver.edu/~egethner/">Dr. Ellen Gethner</a>, was a continuation of my undergrad Algorithms and Analysis class.  Algorithms at the graduate level focused a lot more on proving correctness and runtime boundaries than my undergrad classes.  I always struggled with proofs, but the constant practice I got with this class made me understand the techniques far better.  The sense of satisfaction I felt when I completed a difficult proof was great.</p>
<div id="attachment_1738" class="wp-caption alignright" style="width: 310px"><img src="http://www.nomachetejuggling.com/files/300px-Petersen_graph_3-coloring.png" alt="" title="300px-Petersen_graph_3-coloring" width="300" height="288" class="size-full wp-image-1738" /><p class="wp-caption-text">3-Coloring of the Peterson graph</p></div>
<p>I&#8217;m lucky in that my undergrad course lightly touched on a few subjects that many undergrad courses don&#8217;t mention, namely <a href="http://en.wikipedia.org/wiki/Graph_theory">Graph Theory</a>.  Having seen a bit of Graph Theory before, I found that section of the course a bit more familiar than some of my classmates, and I really enjoyed learning a lot more about it (it helped that it&#8217;s Professor Gethner&#8217;s research area, so she was very excited about it and it showed).  Another large portion of the class was devoted to studying <a href="http://en.wikipedia.org/wiki/Number_theory">Number Theory and Cryptography</a>, both of which I was a little familiar with thanks to a Cryptography course I took as an undergrad.  It was nice to learn in areas that I had seen before but never fully understood, thus really rounding out my grasp of the subjects.</p>
<p>My professor for undergrad Algorithm Analysis and Design was a really nice Japanese man who had a great passion for the subject, but who I had a hard time understanding due to his extremely thick accent.  I never really understood a lot of the material as well as I&#8217;d have liked, particularly <a href="http://en.wikipedia.org/wiki/Dynamic_programming">Dynamic Programming</a> and <a href="http://wwwc3.lanl.gov/mega-math/gloss/compute/greedy.html">Greedy Algorithms</a>.  Professor Gethner is a native English speaker, and it made it so much easier for me to follow the lectures.  <strong>I finally came to a thorough understanding of the material from undergrad</strong>, but I also learned about a lot of new subjects such as M-pire/Earth-Moon graphs, Huffman encodings, Fast Fourier Transform, and computational geometry.</p>
<p>Homeworks were fun and interesting, often with a slightly humorous slant (one encoded message we had to decipher decoded to &#8220;CHILL OUT EVERYONE&#8221;).  Exams were extremely fair, largely based on the homeworks and never testing material that hadn&#8217;t been discussed in class.  I did quite well, getting an A as a final grade.</p>
<h2 id="toc-theory-of-distributed-computing">Theory of Distributed Computing</h2>
<p>Textbook: <a href="http://www.amazon.com/Distributed-Computing-Fundamentals-Simulations-Advanced/dp/0471453242/">Distributed Computing</a></p>
<p>Taught by <a href="http://carbon.ucdenver.edu/~bchlebus/">Dr. Bogdan Chlebus</a>, this was the first course I&#8217;ve taken that had virtually no connection to anything I did as an undergrad.  I took a &#8220;Parallel and Distributed Systems&#8221; course before, but that was a Systems course, focused primarily on implementing shared memory systems at a low level.  This class was much more theoretical, focusing a lot more on proofs (and counterproofs) than implementation.  Occasionally I&#8217;d see terms I was familiar with from previous classes, but 95% of the material was brand-new.  I learned about the <a href="http://en.wikipedia.org/wiki/Consensus_(computer_science)">Consensus</a> problem, various types of shared memory registers, fault detection, byzantine processes, the <a href="http://en.wikipedia.org/wiki/Two_Generals'_Problem">attack problem</a>, the theoretical differences (and similarities) between shared memory and message-passing distributed systems, linearizability and sequential consistency, theoretical mutual exclusion models, and the <a href="http://smartech.gatech.edu/handle/1853/6710">wait-free hierarchy</a>.</p>
<div id="attachment_1744" class="wp-caption alignleft" style="width: 310px"><img src="http://www.nomachetejuggling.com/files/dining_philosophers-e1323298457654-300x292.jpg" alt="" title="dining_philosophers" width="300" height="292" class="size-medium wp-image-1744" /><p class="wp-caption-text">The Dining Philosopher&#039;s Problem</p></div>
<p>I found the course extremely interesting, though sometimes I felt like the presentation of the material left me wondering where it was going.  Rather than present a difficult problem, then discuss the tools used to solve it, often we would be presented with the tools first.  Many times this left me (and other students) studying completely academic-seeming tools without any understanding of how they related to anything else.  For some of the subjects we learned about, the payoff wasn&#8217;t until the very end of the course.</p>
<p>Though the material presentation order left a bit to be desired, the decision as to what material to include in the class was excellent.  We never got into any system-implementation details, always staying very theoretical, focusing on proofs and reductions rather than actually writing code.  All assignments were written with text and occasionally drawings, never any programming required.  Since I went back to grad school to focus on theory and algorithms, <strong>this was right up my alley</strong>, and I really enjoyed it.</p>
<p>Professor Chlebus was very passionate about the subject, and though he had a pretty thick accent, I was able to follow him extremely well.  The homeworks were all really interesting and thought-provoking, and he even supplied hints for many of the problems if you read his lecture notes closely.  Exams were very difficult, often relying more on memorization than understanding, but he also curved the grades to compensate for the obscene difficulty.  In the end, I actually got the highest grade in the class.</p>
<h2 id="toc-grading-fundamentals-of-computing">Grading: Fundamentals of Computing</h2>
<p>I also volunteered to be a grader for an intro course, Fundamentals of Computing.  This was the least rewarding part of my semester, by far.</p>
<p>Though I enjoyed getting a refresher on C++ by reading a LOT of student code, a particular aspect of grading this class marred the experience: <strong>cheating</strong>.</p>
<p>After a few assignments, I began to notice peculiar similarities between student submissions.  I gave the same feedback, word-for-word, on a handful of assignments and around the third time I decided to look at the assignments a bit closer.  It was clear to be that some students were submitting the exact same assignments.</p>
<p>I was really disappointed in my fellow students for this.  I don&#8217;t know what it is about cheating that bothers me so much, but it really irritated me.  I informed the teacher for the class and he gave these students zeroes for the assignments, but it didn&#8217;t seem to have that much effect.</p>
<p><img src="http://www.nomachetejuggling.com/files/Cheating-300x199.jpg" alt="" title="Cheating" width="300" height="199" class="alignright size-medium wp-image-1746" /></p>
<p>On the next assignment, I noticed the same thing, only this time some of the students clumsily renamed variables in arbitrary ways, hoping to trick me.  It was still obvious they were copying, so I brought it to the teacher&#8217;s attention again.  Moreover, there were actually 3 or 4 different clusters of students that copied off of each other within the group.  I spent hours combing over code to find patterns indicating cheating between 40 different assignments, and sent my findings to the teacher.</p>
<p>Finding these cheaters was extremely time-consuming for me, taking far more time than what grading should have reasonably taken.  And yet, despite students getting zeroes as a result of the cheating, <strong>students were still turning in identical, copy-pasted assignments even as late as the final assignment for the class at the end of the semester.</strong></p>
<p>This really ruined the grading experience for me, so I don&#8217;t plan on doing it again.</p>
<h1 id="toc-overall">Overall</h1>
<p>Overall, I&#8217;m incredibly happy with my decision to return to school.  I&#8217;m learning fascinating stuff in a tough but manageable academic environment, and it&#8217;s been very rewarding.</p>
<p>I honestly don&#8217;t know if it&#8217;s the school itself that&#8217;s been so enjoyable, or if it&#8217;s been a matter of getting out what I put in.  Since I&#8217;m paying for school myself and I&#8217;m attending voluntarily (not because I &#8220;have to if I want a job&#8221; as I did as an undergrad), I find myself much more motivated to do the readings, give my best effort on assignments, and pay attention in class.  I only missed one lecture the entire semester, in stark contrast to times as an undergrad where I&#8217;d skip the entire day because it was cold out (sorry Mom).</p>
<p><img src="http://www.nomachetejuggling.com/files/TLtfR-300x198.jpg" alt="" title="TLtfR" width="300" height="198" class="alignleft size-medium wp-image-1748" /></p>
<p>I speak up in class, ask questions, and have even felt a bit like a teacher&#8217;s pet a few times due to my enthusiasm.  A number of other students have come to me asking homework questions like I&#8217;m some kind of expert (I&#8217;m not), which feels great.</p>
<p>Taking only two courses at once (rather than 4 or sometimes 5 as an undergrad) has allowed me to really focus on the material and I&#8217;ve gotten a lot out of it.  There&#8217;s very little from the semester that I feel like I didn&#8217;t understand fully (looking in your direction, Fast Fourier Transform), which gives me a real feeling of accomplishment.  Being able to work in both the academic world of theoretical Computer Science and the practical world of professional Software Engineering has kept a nice balance of satisfying my interests.</p>
<p>I&#8217;ve absolutely loved being back in school, and I can&#8217;t wait for next semester.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/12/21/fall-2011-semester-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scala First Impressions</title>
		<link>http://www.nomachetejuggling.com/2011/12/15/scala-first-impressions/</link>
		<comments>http://www.nomachetejuggling.com/2011/12/15/scala-first-impressions/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 05:42:39 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1763</guid>
		<description><![CDATA[A few months ago, my co-workers and I converted a central part of our codebase from Java and Groovy into Scala. Though I am, by no means, a Scala expert at this point, I wanted to share some of my initial thoughts on the programming language. Writing this blog post is probably a mistake. A [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, my co-workers and I converted a central part of our codebase from Java and Groovy into <a href="http://www.scala-lang.org/">Scala</a>.  Though I am, by no means, a Scala expert at this point, I wanted to share some of my initial thoughts on the programming language.</p>
<p>Writing this blog post is probably a mistake.  A few years ago I shared <a href="http://www.nomachetejuggling.com/2007/09/10/language-marathon-first-impressions-of-ruby-python-and-c/">my thoughts on Ruby</a> after a similar amount of time using it.  When I went back and re-read that post to get the link for this one, I was stunned.  I don&#8217;t even remember disliking Ruby at any point.  <strong>Today, Ruby is one of my favorite programming languages</strong>, and the tool I reach for most readily for almost any project outside of work.  I still love Python as I did in that post, but my view of Ruby has, apparently, completely changed.</p>
<p>Nonetheless, I have some thoughts on Scala and because I have a blog, I suffer from the delusion that there are people who give a shit what I think about it.  </p>
<p>As with any &#8220;first impressions&#8221; post, it&#8217;s entirely possible I will literally discover something that invalidates my complaints tomorrow (maybe even in a comment on this post), so take this with a grain of salt.</p>
<p><span id="more-1763"></span></p>
<h1 id="toc-whats-bad">What&#8217;s Bad?</h1>
<h2 id="toc-compilation-is-slow">Compilation Is Slow</h2>
<p>Our Scala codebase is quite large, divided into many different modules.  At the moment, we have over 57,000 lines of Scala code in a series of modules that make up a central Common Services Tier, which is nothing to shake a stick at.  One observation about using Scala in this way is that compiling and running the Scala code takes a very, very long time.  Far longer than with Java or even Groovy.</p>
<p><img src="http://www.nomachetejuggling.com/files/scala_logo-e1323974677125-300x83.png" alt="" title="scala_logo" width="300" height="83" class="alignright size-medium wp-image-1777" /></p>
<p>I am aware of the existence of the <a href="http://www.scala-lang.org/docu/files/tools/fsc.html">Fast Scala Compiler</a>, which offers a substantial speed improvement.  However, while I was able to get FSC working in IntelliJ without an issue, getting Gradle to use it to build our project has proven surprisingly difficult.  I&#8217;ve followed the tutorials that are available, but ultimately I failed.</p>
<p>And no, the Scala Build Tool is not an option.  It simply doesn&#8217;t offer the kind of power that we require and are getting out of Gradle.</p>
<p>It&#8217;s not like compilation is taking hours or anything, but it&#8217;s a minute or so longer than it ought to be for the amount of code, which adds up to a lot of time.  It&#8217;s much faster to compile and run Scala from IntelliJ because I got FSC working in it.  As a result, I rarely have to compile from command-line, but when I do I wish it was faster.</p>
<h2 id="toc-interop-is-a-bitch">Interop Is A Bitch</h2>
<p>We didn&#8217;t convert to Scala whole-hog, and I dont think we intend to.  Most of our client-facing sites are written with Grails, with the controllers calling a number of services written in Java and Groovy.  </p>
<p>Using Java or Groovy from Scala is a breeze.  Using Java and Groovy from each other are also a breeze.  Using Scala from Java or Groovy pretty much makes me want to drink a pitcher of boiling lava.</p>
<p>I won&#8217;t pretend to understand the design decisions that went into Scala, but I&#8217;m definitely annoyed at the fact that <code>scala.List</code>s do not implement the <code>java.util.List</code> interface.  It seems to me that Scala could have had the full benefit of using its own lists within the Scala language while still implementing that trivially-small interface.  Doing so would have made it so much easier to at least pass Scala&#8217;s lists to Java or Groovy methods that are expecting a <code>java.util.List</code> or a <code>java.util.Collection</code>. I&#8217;ve had to import <code>scala.collection.JavaConversions</code> into more .java and .groovy files than I care to recount.</p>
<p>Of course, this wouldn&#8217;t solve the problem of passing Java <code>List</code>s into Scala, which resembles this beauty:</p>
<pre class="brush: java;">
scala.collection.JavaConversions.asScalaBuffer(existing).toList()
</pre>
<p>Using <code>trait</code>s, Scala can give you something resembling multiple inheritance.  This is a powerful addition to the toolbox, but it also makes classes surprisingly difficult to use (and, in particular, mock) in Java or Groovy.  As a result, we tend to use this powerful ability sparingly, which is a shame.</p>
<h2 id="toc-its-young">It&#8217;s Young</h2>
<p>Scala is so young that there isn&#8217;t much in the way of idiomatic guidelines for it.  <strong>I don&#8217;t have a good grasp on Scala best practices or patterns.</strong></p>
<p><img src="http://www.nomachetejuggling.com/files/eff_java-239x300.jpg" alt="" title="eff_java" width="239" height="300" class="alignleft size-medium wp-image-1782" /></p>
<p>A lot of the Scala code I write I have little confidence in, in terms of design.  When I write good Java or Groovy code, I know it&#8217;s good, and part of that is I&#8217;ve read so much about those languages that I know what most other developers consider easy to understand.</p>
<p>Java has been around so long that the Java community has learned what kinds of things you can do that make code hard to maintain, and countless books have been written on how to avoid those things.  Most of those tips extend to Groovy as well, but not to Scala.  In fact, some of those patterns and practices seem like antipatterns in Scala.</p>
<p>Whatever book is the &#8220;Effective Java&#8221; of Scala, I&#8217;d love to read it (though I don&#8217;t think it yet exists).  A coworker told me that it was unnecessary since &#8220;Scala is effective Java.&#8221;  What a <a href="http://twitter.com/#!/chris_wood">douche</a>.</p>
<h2 id="toc-the-apis-can-be-ugly">The APIs Can Be Ugly</h2>
<p>I&#8217;ve argued with Java developers before about operator overloading.  Many feel like operator overloading leads to ugly APIs, but I&#8217;ve always said that more power is better, and developers can simply have the discipline not to overuse a feature like operator overloading.  <strong>Scala has convinced me I&#8217;m probably wrong.</strong></p>
<p>We are heavily using the Scala library <a href="http://dispatch.databinder.net/">Dispatch</a> in our code.  Here are some methods defined on the class <a href="http://databinder.net/dispatch-doc/#dispatch.RequestVerbs">RequestVerbs</a>:</p>
<ul>
<li><code>/</code> &#8211; Append an element to the request path.</li>
<li><code>&lt;&amp;</code> &#8211; Combine this request with another</li>
<li><code>&lt;:&lt;</code> &#8211; Add headers to the request.</li>
<li><code>&lt;&lt;</code> &#8211; POST the parameter.</li>
<li><code>&lt;&lt;&lt;</code> &#8211; PUT the parameter.</li>
<li><code>&lt;&lt;?</code> &#8211; Add query parameters.</li>
<li><code>&lt;&amp;</code> &#8211; Combine this request with a handler.</li>
<li><code>&gt;\</code> &#8211; Set the character set.</li>
</ul>
<p>This is terrible. It&#8217;s impossible to write <a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">clean code</a> against this API, because there is no way to express intent.  <strong>Any developer reading the code will have to pull up the API to understand what is happening</strong> unless he or she is intricately familiar with the library already.</p>
<p>It would be one thing if this object had regular, English methods and the overloaded operators called them (or vice versa), but that&#8217;s not the case.  There&#8217;s no way to call these methods without invoking these random-seeming combinations of symbols.  The code ends up looking like <a href="http://www.muppetlabs.com/~breadbox/bf/">Brainfuck</a>.</p>
<p>Rather than seeing Dispatch as an embarrassing wart on the Scala community, it seems to be generally highly regarded, <a href="http://www.scalafied.com/84/one-liner-for-a-urls-last-modified-header-as-date">even praised</a> for its abysmal API.  There seems to be a large constituency of Scala developers who are enamored with operator overloading, seemingly without regard to the adage &#8220;just because you <em>can</em> do something, that doesn&#8217;t mean you <em>should</em>.&#8221;</p>
<h1 id="toc-whats-good">What&#8217;s good?</h1>
<h2 id="toc-the-paradigms-are-great-but-are-they-exclusive">The Paradigms Are Great (But Are They Exclusive?)</h2>
<p>There is no doubt that our Scala code is highly functional, emphasizing composing functions together rather than declaring steps.  I love functional code, I think it reads much more clearly than iterative code, so <strong>this is a huge win</strong>.  Our objects are always immutable and much more thread-safe.</p>
<p>But are we doing this because of Scala? Scala may <strong>encourage</strong> immutability, but it does not <strong>demand</strong> it. You can declare variables as <code>var</code>s even though you’re encouraged to declare them as <code>val</code>s. Our team is following functional coding practices because we chose to, not because Scala is enforcing it.</p>
<p>I’ve been making my Java classes immutable and relying on the <a href="http://en.wikipedia.org/wiki/Builder_pattern">Builder Pattern</a> for object construction for years. And I’ve been writing functional-style code using <a href="http://code.google.com/p/guava-libraries/">Google Guava</a> in Java for about as long, which is even easier with Groovy.</p>
<p>These paradigms have been part of my coding practices for a while, and since we’re only using them in Scala because we agreed to do so (and could have just as easily not done so), couldn’t we have agreed to do them in Java or Groovy as well? </p>
<p><a href="http://clojure.org/">Clojure</a>, I’d understand. Clojure pretty strongly enforces the functional paradigm, it’s not a matter of choice really. But since Scala doesn’t, at least not as much, I’m not really sure I know what Scala is buying us, though I suppose there are some particular functional practices that Scala makes much easier.</p>
<h2 id="toc-it-keeps-idiots-out">It Keeps Idiots Out</h2>
<p>The biggest advantage of Scala, at least so far, is that it keeps a certain type of coder out of the codebase.  Groovy did not accomplish this, since Java code can compile as Groovy with minimal modification.</p>
<div id="attachment_1785" class="wp-caption alignright" style="width: 310px"><img src="http://www.nomachetejuggling.com/files/idiot-300x216.jpg" alt="" title="idiot" width="300" height="216" class="size-medium wp-image-1785" /><p class="wp-caption-text">GTFO.</p></div>
<p>Because Scala is a bit more cutting-edge, and involves some pretty serious shifts in thinking, the kinds of coders who are capable of doing their job with Java but have no interest in learning new languages have little interest in understanding Scala well enough to make changes to Scala code.  Most half-assed attempts to do so are met with compilation failures.</p>
<p>Basically this boils down to Paul Graham&#8217;s <a href="http://www.paulgraham.com/pypar.html">Python Paradox</a>, in which he claims that the caliber of developers who know Python will, on average, be better than the typical Java programmer, which creates an advantage to using Python in your project that is completely separate from the capabilities of the language itself.</p>
<p>I feel kind of bad including this as an advantage, because it&#8217;s esssentially &#8220;functional programming is difficult to learn, so it excludes dumb people,&#8221; but it&#8217;s kind of true.  It&#8217;s had a positive impact, and I appreciate Scala for this, even though it&#8217;s a backhanded benefit.</p>
<h1 id="toc-conclusions">Conclusions</h1>
<p>Though I list more cons than pros, I&#8217;m enjoying Scala.  I like learning new languages and Scala has a lot of movement in the JVM ecosystem, so it&#8217;s nice that I&#8217;m not behind my peers in learning it.</p>
<p>I also like that my team is writing immutable, thread-safe, highly functional code.  Personally, I think we could be doing that in Java or Groovy or any other language really, with a little added discipline.  That said, to some extent if Scala is what&#8217;s making everyone do that, then Scala is good thing, in a &#8220;the ends justify the means&#8221; sort of way.</p>
<p>Overall, I view Scala very much how I view C++.  C++ is <a href="http://damienkatz.net/2004/08/why-c-sucks.html">not really a good language</a> at all, but it was of great historical importance.  C++ supplied a Object-Oriented Programming layer on top of C, which allowed iterative-style C programmers to transition to OOP at their own pace.  Not a great language, but a necessary compromise to help the transition.  I view Scala in much the same way, as a transitional language to help get professional Java programmers more comfortable with functional programming.  Today&#8217;s Scala programmers are tomorrow&#8217;s Clojure or Haskell programmers, and in that sense Scala serves a very valuable purpose.</p>
<p>I&#8217;m definitely still getting comfortable with the language, and I can easily see myself viewing it more and more favorably as time goes on, but <strong>I&#8217;m not quite at a point where I&#8217;m sure it&#8217;s buying me much</strong>.  I love functional programming and always have, and Scala <b>does</b> encourage me to do so, which is nice.  I also love <a href="http://www.scala-lang.org/node/120">Pattern Matching</a>, that&#8217;s a badass feature I could see myself eventually seeing as indispensable.</p>
<p>A lot of my issues with the language (compilation speed, lack of best practices) are due largely to how young the language is, so they&#8217;re likely to improve over time as well.  In a way, even my complaint about the ugly APIs is due to the age of the language: if it were older there would probably be a decent alternative to Dispatch.</p>
<p>Overall, I&#8217;m excited to continue using Scala and see it improve over time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/12/15/scala-first-impressions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Star Wars Saga: Suggested Viewing Order</title>
		<link>http://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/</link>
		<comments>http://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 16:11:08 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Movies]]></category>
		<category><![CDATA[blu-ray]]></category>
		<category><![CDATA[star wars]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1559</guid>
		<description><![CDATA[Brace yourselves, what follows is an amazingly long blog post about Star Wars. I&#8217;ve already discussed how I&#8217;m not a huge fan of the various modifications made to the original Star Wars trilogy, so it&#8217;s reasonable to assume I&#8217;m not a big fan of the prequel trilogy either. There are many people who dislike the [...]]]></description>
			<content:encoded><![CDATA[<p>Brace yourselves, what follows is an amazingly long blog post about Star Wars.</p>
<p>I&#8217;ve already discussed how I&#8217;m <a href="http://www.nomachetejuggling.com/2011/10/07/first-world-problems-blu-ray-woes/#toc-star-wars">not a huge fan of the various modifications</a> made to the original Star Wars trilogy, so it&#8217;s reasonable to assume I&#8217;m not a big fan of the prequel trilogy either.  There are many people who dislike the prequel trilogy so much that they don&#8217;t even consider watching them.  On bad days, I&#8217;m one of those people, but on good days I see some value in the prequel trilogy, even though I consider them inferior in virtually every way.</p>
<p>For people that couldn&#8217;t care less about the prequel trilogy, I suggest <a href="http://originaltrilogy.com/forum/topic.cfm/Harmys-STAR-WARS-Despecialized-Edition-HD-AVCHD-DVD9-and-NTSC-DVD5-AVAILABLE-see-1st-post/topic/12713/">Harmy&#8217;s Despecialized Editions</a>.  They are 720p blu-ray discs (AVCHD discs actually) that are the result of &#8220;Harmy&#8221; from <a href="http://originaltrilogy.com">The Original Trilogy forums</a> painstakingly reconstructing the theatrical releases of all three films utilizing a wide variety of video sources as well as custom mattes.  Downloading, burning, labeling, and printing cases for these films is one of the neckbeardiest things I&#8217;ve done (aside from writing this blog post), and I&#8217;m extremely glad I did it.  When I feel like watching Star Wars for just me, these are the ones I watch.  If that&#8217;s enough for you as well, stop reading now.</p>
<div id="attachment_1619" class="wp-caption aligncenter" style="width: 590px"><img src="http://www.nomachetejuggling.com/files/2011-10-21_22-52-35_694-e1319259575859-580x329.jpg" alt="" title="" width="580" height="329" class="size-large wp-image-1619" /><p class="wp-caption-text">Harmy, king of nerds</p></div>
<p><span id="more-1559"></span></p>
<p>But what can you do if you <em>do</em> wish to involve the prequel trilogy?  Maybe you&#8217;re showing the films to a younger crowd that won&#8217;t be able to appreciate and enjoy films with distractingly dated special effects.  Maybe you don&#8217;t want to spend the effort to download and burn your own discs, and purchasing the official Blu-rays is fine for you.  Maybe you&#8217;ve accepted that the original theatrical editions are no longer considered canon, and you&#8217;re a nerd that cares about things like that.  Hell, maybe you actually <b>like</b> the prequels (seriously?).</p>
<p>Whatever your reason, if you are showing someone the official editions of Star Wars for the first time, you have to make a decision about which order to show the films.</p>
<h1 id="toc-two-choices">Two Choices</h1>
<p>There are two obvious choices for watching the Star Wars saga.</p>
<ul>
<li><strong>Release Order</strong> &#8211; Watch the films in the order they came out, recreating your experience with the films for someone new to them.</li>
<li><strong>Episode Order</strong> &#8211; Watch the films in the order <a href="http://scifi.about.com/od/starwarsfilms/a/Star-Wars-Faq-Whats-The-Best-Viewing-Order-For-The-Star-Wars-Films.htm">George Lucas intends</a>, starting with Episode I and going straight through to Episode VI</li>
</ul>
<p>There are two critical flaws with both of these orders, unfortunately, that prevent either from being appropriate.</p>
<p><b>The problem with Episode Order is that it ruins the surprise that Vader is Luke&#8217;s father.</b>  If you think that this reveal doesn&#8217;t matter since it&#8217;s common knowledge, I suggest you watch the <a href="http://www.youtube.com/watch?v=ZbV5hn_ET0U">looks on these kids&#8217; faces</a>.  This reveal is one of the most shocking in film history, and if a newcomer to the series has managed to avoid having it spoiled for them, watching the films in Episode Order would be like watching the ending of The Sixth Sense first.</p>
<p>The other problem with Episode Order is that the prequels don&#8217;t really have a story.  They&#8217;re just background for the real story, which is Luke&#8217;s attempt to destroy the Empire and save his father.  Watching 3 films of backstory is boring if you&#8217;ve never seen the films they&#8217;re the background to.  Hell, that&#8217;s why George Lucas made A New Hope first, he knew if he started with Episode I he&#8217;d never be able to complete the series.  Starting someone off with Episode I is a surefire way to ensure they don&#8217;t make it through the entire franchise.</p>
<p><img src="http://www.nomachetejuggling.com/files/jedi_ruined-300x128.jpg" alt="" title="jedi_ruined" width="300" height="128" class="alignright size-medium wp-image-1580" /></p>
<p>Unfortunately, <b>Release Order is also an instant failure, and the reason is a single shot</b>.  If you&#8217;re watching the original trilogy first, then after the Empire is destroyed and everyone is celebrating, Luke looks over at his mentors, Ben Kenobi and Yoda, and suddenly they are joined by&#8230; some random creepy looking teenager who needs a haircut.  Placing Hayden Christensen in the ending of Jedi, since he&#8217;s not in ANY of the other films, turns an ending that should be celebratory into one that is confusing for the viewer.  The fact that Christensen looks like he&#8217;s undressing someone with his eyes doesn&#8217;t help.</p>
<p>So neither order really works.  What to do?</p>
<h1 id="toc-an-alternative-suggestion">An Alternative Suggestion</h1>
<p>How can you ensure that a viewing keeps the Vader reveal a surprise, while introducing young Anakin before the end of Return of the Jedi?</p>
<p>Simple, watch them in this order: IV, V, I, II, III, VI.</p>
<p>George Lucas believes that Star Wars is the story of Anakin Skywalker, but it is not.  The prequels, which establish his character, are so poor at being character-driven that, if the series is about Anakin, the entire series is a failure.  Anakin is not a relatable character, Luke is.</p>
<p>This alternative order inserts the prequel trilogy into the middle, allowing the series to end on the sensible ending point (the destruction of the Empire) while still beginning with Luke&#8217;s journey.</p>
<p>Effectively, this order keeps the story Luke&#8217;s tale.  Just when Luke is left with the burning question &#8220;how did my father become Darth Vader?&#8221; we take an extended flashback to explain exactly how.  Once we understand how his father turned to the dark side, we go back to the main storyline and see how Luke is able to rescue him from it and salvage the good in him.</p>
<p><img src="http://www.nomachetejuggling.com/files/vader-300x202.jpg" alt="" title="vader" width="300" height="202" class="alignleft size-medium wp-image-1578" /></p>
<p>The prequel backstory comes at the perfect time, because Empire Strikes Back ends on a huge cliffhanger.  Han is in carbonite, Vader is Luke&#8217;s father, and the Empire has hit the rebellion hard.  Delaying the resolution of this cliffhanger makes it all the more satisfying when Return of the Jedi is watched.</p>
<p>Narratively, it&#8217;s just like a movie that starts with a big opening, then fades to &#8220;2 years earlier&#8221; for most of the movie, until it catches up with the present time and concludes.</p>
<h1 id="toc-introducing-machete-order">Introducing: Machete Order</h1>
<p>Now I&#8217;d like to modify this into what I&#8217;ve named <b>Machete Order</b> on the off chance that this catches on because I&#8217;m a vain asshole.</p>
<p>Next time you want to introduce someone to Star Wars for the first time, watch the films with them in this order: <strong>IV, V, II, III, VI</strong></p>
<p>Notice something?  Yeah, Episode I is gone.</p>
<p><img src="http://www.nomachetejuggling.com/files/machete_order-580x142.jpg" alt="" title="machete_order" width="580" height="142" class="aligncenter size-large wp-image-1592" /></p>
<p>Episodes II and III aren&#8217;t exactly Shakespeare, but standing next to the complete and utter trainwreck that is Episode I, they sure look like it.</p>
<p>Episode I is a failure on every possible level.  <a href="http://redlettermedia.com/plinkett/star-wars/star-wars-episode-1-the-phantom-menace/">The acting, writing, directing, and special effects are all atrocious, and the movie is just plain boring.</a>  Luckily, George Lucas has done everyone a favor by making the content of Episode I completely irrelevant to the rest of the series.  Seriously, think about it for a minute.  Name as many things as you can that happen in Episode I and actually help flesh out the story in any subsequent episode.  I can only think of one thing, which I&#8217;ll mention later.</p>
<p>Every character established in Episode I is either killed or removed before it ends (Darth Maul, Qui-Gon, Chancellor Valorum), unimportant (Nute Gunray), or established better in a later episode (Mace Windu).  Does it ever matter that Palpatine had an apprentice before Count Dooku?  Nope, Darth Maul is killed by the end of Episode I and never referenced again.  You may as well just start with the assumption that Dooku was the only apprentice.  Does it ever matter that Obi-Wan was being trained by Qui-Gon?  Nope, Obi-Wan is well into training Anakin at the start of Episode II, Qui-Gon is completely irrelevant.</p>
<p>Search your feelings, you know it to be true!  Episode I doesn&#8217;t matter at all.  You can start the prequels with Episode II and miss absolutely nothing.  The opening crawl of Episode II establishes everything you need to know about the prequels: a bunch of systems want to leave the Republic, they are led by Count Dooku, and Senator Amidala is a senator who is going to vote on whether the Republic is going to create an army.  Natalie Portman is called Senator Amidala twice in the first 4 minutes of the movie, so there&#8217;s no question of who&#8217;s who.</p>
<h2 id="toc-what-gets-removed">What Gets Removed?</h2>
<p>Here&#8217;s some stuff that you no longer have to see as part of your Star Wars viewing experience, thanks to skipping Episode I.</p>
<div id="attachment_1574" class="wp-caption alignright" style="width: 310px"><img src="http://www.nomachetejuggling.com/files/jarjar-300x200.jpg" alt="" title="jarjar" width="300" height="200" class="size-medium wp-image-1574" /><p class="wp-caption-text">Buh-bye, Binks!</p></div>
<ul>
<li>Virtually no Jar-Jar.  Jar-Jar has about 5 lines in Episode II, and zero in Episode III.</li>
<li>No midichlorians.  There is only one reference to midichlorians after Episode I, and in the context it appears to mean something as benign as &#8220;DNA.&#8221;</li>
<li>No Jake Lloyd.  Sorry Jake, your acting is terrible and I never really wanted to see Darth Vader as a little boy.</li>
<li>No confusing Padme/Queen switcheroo.  The whole subplot with Padme and her decoy makes absolutely no sense.  It&#8217;s clear that this was just so people could interact with Padme without knowing she was the Queen, but it&#8217;s incredibly convoluted and pointless.</li>
<li>Less confusing master/apprentice relationships.  Darth Sidious is training Count Dooku, Obi-Wan is training Anakin.  No other trainer/trainee relationships exist to confuse the backstory.  Fewer characters to learn about, so the story is more focused.</li>
<li>Nothing about trade disputes.  The &#8220;problem&#8221; as of Episode II is that a group of systems want to leave the Republic.  This is much easier to understand for a kid than trade disputes.</li>
<li>No pod racing.  Seriously, who gives a shit?  An action sequence for the sake of an action sequence and it goes on forever.  A huge number of plot holes surrounding gambling and the subsequent freeing of Anakin are removed as well.</li>
<li>No virgin birth.  We simply don&#8217;t know or care who Anakin&#8217;s father is, and the subtle implication that it&#8217;s Palpatine is gone.</li>
</ul>
<p>But booting Episode I isn&#8217;t merely about pretending a crappy movie doesn&#8217;t exist.  Viewing Episode II immediately after V and Episode III immediately before VI actually tells the story <b>better</b> than including Episode I does.</p>
<h2 id="toc-why-does-this-work-better">Why Does This Work Better?</h2>
<p><img src="http://www.nomachetejuggling.com/files/starwars-300x199.jpg" alt="" title="starwars" width="300" height="199" class="alignleft size-medium wp-image-1576" /></p>
<p>As I mentioned, this creates a lot of tension after the cliffhanger ending of Episode V.  It also uses the original trilogy as a framing device for the prequel trilogy.  Vader drops this huge bomb that he&#8217;s Luke&#8217;s father, then we spend two movies proving he&#8217;s telling the truth, then we see how it gets resolved.  The Star Wars watching experience gets to start with the film that does the best job of establishing the Star Wars universe, Episode IV, and it ends with the most satisfying ending, Episode VI.  It also starts the series off with the two strongest films, and allows you to never have to either start or end your viewing experience with a shitty movie.  Two films of Luke&#8217;s story, two films of Anakin&#8217;s story, then a single film that intertwines and ends both stories.</p>
<p>Beyond this, Episode I establishes Anakin as a cute little kid, totally innocent.  But Episode II quickly establishes him as impulsive and power-hungry, which keeps his character consistent with eventually becoming Darth Vader.  Obi-Wan never really seems to have any control over Anakin, struggling between treating him as a friend (their very first conversation together in Episode II) and treating him as an apprentice (their second conversation, with Padme).  Anakin is never a carefree child yelling &#8220;yippee&#8221;, he&#8217;s a complex teenager nearly boiling over with rage in almost every scene.  It makes much more sense for Anakin to have always been this way.</p>
<p>In the opening of Episode II, Padme refers to Anakin as &#8220;that little boy from Naboo.&#8221;  The opening crawl establishes that she is the &#8220;former queen of Naboo.&#8221;  The two of them look approximately the same age in Episode II, so the viewer can naturally conclude that the two of them were friends as children.  This completely hides the totally weird age gap between them from Episode I, and lends a lot of believability to the subsequent romance.  Scenes in which they fall for each other seem to build on a childhood friendship that we never see but can assume is there.  Since their relationship is the eventual reason for Anakin&#8217;s fall to the dark side, having it be somewhat believable makes a big difference.</p>
<p><img src="http://www.nomachetejuggling.com/files/obiandani-e1319152749809-300x171.jpg" alt="" title="obiandani" width="300" height="171" class="alignright size-medium wp-image-1567" /></p>
<p>Obi-Wan now always has a beard for the entire duration of the series, and Anakin Skywalker always wears black.  Since these two characters are played by different actors (and are the only characters in the series with such a distinction), having them look visually consistent does a great deal toward reinforcing they are the same people.</p>
<p>This order also preserves <b>both</b> twists.  George Lucas knew that watching the films in Episode Order would remove the Vader twist, so he added the Palpatine twist to compensate.  Since we don&#8217;t really meet the Emperor until Episode VI, this order preserves the twist around Palpatine taking over as Emperor.  Episode I establishes that Darth Sidious is manipulating the Trade Federation in the opening scene of the film, and it&#8217;s pretty obvious Sidious is Palpatine.  But if you skip Episode I, all we ever see is that Count Dooku is leading a separatist movement, all on his own.  He tells Obi-Wan that the Senate is under the control of a Sith lord named &#8220;Darth Sidious&#8221;, but at the end of the movie, after Dooku flees from Geonosis, he meets with his &#8220;master&#8221;, who turns out to be Darth Sidious.  This is the first time we realize that the separatist movement is actually being controlled by Sidious, who later turns out to be Palpatine in Episode III.  This order also keeps the fact that Luke and Leia are siblings a surprise, it simply moves the surprise to Episode III instead of VI, when Padme announces her daughter&#8217;s name.  This is actually a more effective twist in this context than when Obi-Wan just tells Luke in Return of the Jedi.</p>
<h2 id="toc-what-works-best">What Works Best?</h2>
<p>Best of all, this order actually makes a particular tension in Return of the Jedi stronger.  </p>
<p>Remember, we see in Episode V that Luke&#8217;s vision in the cave on Degobah is that he turns into Darth Vader, then we find out Vader is his father.  Then we watch Episodes II and III, in which his father turns to the dark side in order to protect his loved ones.  After that we go back to VI, where eventually Luke confronts the Emperor.  </p>
<p><img src="http://www.nomachetejuggling.com/files/jediluke-e1319294859642-300x213.png" alt="" title="jediluke" width="300" height="213" class="alignleft size-medium wp-image-1665" /></p>
<p>The first time we see Luke in Return of the Jedi, he&#8217;s wearing all-black, just like his father did.  He gives R2D2 and C-3P0 to Jabba the Hutt, much to their surprise.  Luke isn&#8217;t exactly looking like a clean-cut Jedi like he claims.  Then, when he finally enters Jabba&#8217;s palace, the musical cue sounds a bit like the Imperial March, and the way he enters with the light behind him makes it unclear if he is Luke or Vader.  Then, he <b>force chokes Jabba&#8217;s guards</b>, something only Vader has done in the series!  Nobody else sees him do this.</p>
<p>When he confronts Jabba, he warns him that he&#8217;s taking his friends back.  He says Jabba can either profit from this, &#8220;or be destroyed.&#8221;  Furthermore, he tells Jabba &#8220;not to underestimate my power.&#8221;  The last time this phrase was used, it was by Anakin when dueling Obi-Wan.  When watching Jedi on its own, Luke just seems a tad arrogant during these scenes.  When watching Jedi immediately after watching Revenge of the Sith, the message is clear: <b>Luke Skywalker is moving toward the Dark Side</b>.</p>
<p>Why does this matter?  Because at the end of Jedi, Luke confronts the Emperor.  The Emperor explains that the assault on the new Death Star is a trap and that his friends are going to die, and he keeps taunting Luke, telling him to grab his lightsaber and fight him.  The film is trying to create a tension that Luke might embrace the Dark Side, but it was never really believable.  However, within the context of him following in his father&#8217;s footsteps and his father using the power of the dark side to save people, with Luke&#8217;s friends being killed just outside the Death Star window, this is much more believable.</p>
<p>Shortly after, Luke goes apeshit and beats the hell out of Vader, clearly succumbing to his anger.  He overpowers Vader with rage and cuts his arm off, just like Anakin did to Windu in Episode III.  Having the very real threat of Luke following in his father&#8217;s path made clear by watching II and III before VI heightens the tension of this scene, and it actually makes Return of the Jedi better.  Yes, watching Revenge of the Sith makes Return of the Jedi a better, more effective film.  Considering it&#8217;s the weakest of the original trilogy films, this improvement is welcome.  </p>
<h2 id="toc-what-doesnt-work-better">What Doesn&#8217;t Work Better?</h2>
<p>Machete Order isn&#8217;t perfect.  There are a few tiny issues that arise watching the films in this order.</p>
<p>The Kamino sequence is a little confusing.  Since the cloners seem to have been &#8220;expecting&#8221; Kenobi, it leads the viewer to wonder if Episode I showed him creating the clone army or something.  Hilariously, Episode I doesn&#8217;t actually explain anything or make this scene less misleading, but the fact that the viewer knows a movie got skipped amplifies the confusion.</p>
<p>Qui-Gon is mentioned once in Episode II and once in Episode III.  Luckily, both times he is mentioned, his relationship to the characters is restated, so it works.  Dooku explains that Obi-Wan&#8217;s old master Qui-Gon was once Dooku&#8217;s apprentice, and then in Episode III Yoda tells Obi-Wan that Qui-Gon has learned to communicate after death.  It&#8217;s alright, just a little weird.</p>
<p>Episodes II and III both talk about Anakin being part of a prophecy which is never really explained (because it was explained in Episode I).  This is unfortunate, but on the plus side the last time it&#8217;s mentioned in Episode III, Yoda says it may have been misinterpreted.</p>
<p><img src="http://www.nomachetejuggling.com/files/aniep2-300x126.jpg" alt="" title="aniep2" width="300" height="126" class="alignright size-medium wp-image-1572" /></p>
<p>The weakest part of this order is when Anakin returns to Tatooine.  We don&#8217;t know his mother is a slave, and we don&#8217;t know he built C-3P0.  When he has visions of his mother dying and returns, Watto says he sold her.  That&#8217;s not something you expect to hear about a Jedis&#8217;s mother, so it&#8217;s a bit jarring.  When Anakin goes to the Lars moisture farm, Threepio calls him &#8220;the maker&#8221; and they act like they know each other, but it&#8217;s not stated outright that Anakin created Threepio.  This definitely draws attention to the fact that one of the films was skipped.  This is the one, singular thing made genuinely more confusing by skipping Episode I.</p>
<h1 id="toc-give-it-a-shot">Give It A Shot</h1>
<p>You might be wondering if it&#8217;s worth skipping II and only watching III, just to establish young Anakin in time for Jedi.  I don&#8217;t recommend this, every character you need to know for Episode III who was introduced in Episode I is reintroduced in Episode II with a quick line of dialogue, but Episode III just assumes you know who everyone is.</p>
<p>This order doesn&#8217;t even interfere with canon &#8211; everything that happens in Episode I is still canonically compatible with this ordering, we simply don&#8217;t watch it.</p>
<p>I&#8217;ve tried clearing my brain out and watching the films in this order and it makes the overall experience vastly more enjoyable.  If you find someone who has never seen any Star Wars movies, try showing them the films in this order and post a comment explaining any particular points of confusion they had while watching.  My hunch is there won&#8217;t be many if any at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Why The Complete Bipartite Graph K3,3 Is Not Planar</title>
		<link>http://www.nomachetejuggling.com/2011/10/29/why-the-complete-bipartite-graph-k33-is-not-planar/</link>
		<comments>http://www.nomachetejuggling.com/2011/10/29/why-the-complete-bipartite-graph-k33-is-not-planar/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 14:00:10 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1617</guid>
		<description><![CDATA[The graphs $$K_5$$ and $$K_{3,3}$$ are two of the most important graphs within the subject of planarity in graph theory. Kuratowski&#8217;s theorem tells us that, if we can find a subgraph in any graph that is homeomorphic to $$K_5$$ or $$K_{3,3}$$, then the graph is not planar, meaning it&#8217;s not possible for the edges to [...]]]></description>
			<content:encoded><![CDATA[<p>The graphs $$K_5$$ and $$K_{3,3}$$ are two of the most important graphs within the subject of planarity in graph theory.  <a href="http://en.wikipedia.org/wiki/Planar_graph#Kuratowski.27s_and_Wagner.27s_theorems">Kuratowski&#8217;s theorem</a> tells us that, if we can find a subgraph in any graph that is <a href="http://en.wikipedia.org/wiki/Homeomorphism_(graph_theory)">homeomorphic</a> to $$K_5$$ or $$K_{3,3}$$, then the graph is not planar, meaning it&#8217;s not possible for the edges to be redrawn such that they are none overlapping.</p>
<div id="attachment_1646" class="wp-caption aligncenter" style="width: 412px"><img src="http://www.nomachetejuggling.com/files/k33andk5.png" alt="" title="k33andk5" width="402" height="122" class="size-full wp-image-1646" /><p class="wp-caption-text">K5 and K3,3</p></div>
<p>Of course, this theorem relies on the fact that $$K_5$$ and $$K_{3,3}$$ are, themselves, not planar.  While it&#8217;s pretty easy to see $$K_5$$ is not planar, $$K_{3,3}$$ is a bit more involved.  I&#8217;ve read a lot of proofs of this, but frankly I found most of them sorely lacking.  Here I try my hand at providing a clearer proof than what you may find elsewhere.  Hopefully my explanation will make things click for a Googling student.</p>
<p><span id="more-1617"></span></p>
<h1 id="toc-intuition">Intuition</h1>
<p>First I want to simply convince you.  This won&#8217;t be as formal a proof as I intend to provide, but I want to give a sense of the intuition.  I&#8217;m a visual learner, so often I find that an informal explanation or a series of examples is more convincing to me personally than a proof.</p>
<p>First, let&#8217;s remove three edges from $$K_{3,3}$$.  This will be a new graph that we&#8217;ll call $$G$$.  The edges we&#8217;re removing are going to be the straight vertical edges, the ones that join a vertex with it&#8217;s counterpart on the opposite side of the graph (treating the top and bottom as sides).  We&#8217;ll be adding these back later, but we&#8217;re going to remove them for now.</p>
<div id="attachment_1638" class="wp-caption aligncenter" style="width: 192px"><img src="http://www.nomachetejuggling.com/files/G.png" alt="" title="G" width="182" height="122" class="size-full wp-image-1638" /><p class="wp-caption-text">Modified graph G</p></div>
<p>We&#8217;ve also labeled the vertices clockwise from $$a$$ to $$f$$ for clarity.</p>
<p>Now, it&#8217;s easy to see that $$G$$ is planar.  We can re-arrange the vertices and make a simple hexagon out of the graph.</p>
<p><img src="http://www.nomachetejuggling.com/files/g_wheel.png" alt="" title="g_wheel" width="162" height="182" class="aligncenter size-full wp-image-1637" /></p>
<p>Clearly, $$G$$ is planar.  But the real question is, what about $$K_{3,3}$$?  Remember, we removed three edges from the graph to get $$G$$.  If $$G$$ is planar and $$K_{3,3}$$ is not, then it must be impossible to add those three edges back into the graph without having at least two of them overlap.</p>
<p>The edges missing are $$(a,f)$$, $$(b, e)$$, and $$(c, d)$$.  You can see that all of of those edges have to cross the middle of the hexagon, so there&#8217;s no way to put three, or even two edges into the middle of it without them crossing.</p>
<p>Even going around the outside of the graph doesn&#8217;t help.  If you put one edge outside and one edge inside, you still have one more edge to reinsert.  No matter what, at least two of the three edges are going to have to cross each other.  Clearly, $$K_{3,3}$$ is not planar.</p>
<p><img src="http://www.nomachetejuggling.com/files/g_wheel2.png" alt="" title="g_wheel2" width="181" height="202" class="aligncenter size-full wp-image-1634" /></p>
<h1 id="toc-formal-proof-by-contradiction">Formal Proof by Contradiction</h1>
<p>Intuition is great, but let&#8217;s nail down the proof with a bit more mathematical precision.  We&#8217;re going to do a proof by contradiction.  </p>
<p>First, let&#8217;s assume for the purpose of contradiction that $$K_{3,3}$$ <b>is</b> planar.</p>
<p>If it is planar, then is must obey <a href="http://en.wikipedia.org/wiki/Planar_graph#Euler.27s_formula">Euler&#8217;s Formula</a>, which is that </p>
<p>$$$V &#8211; E + F = 2$$$</p>
<p>for number of vertices $$V$$, number of edges $$E$$, and number of faces $$F$$, which can be rewritten as $$F = E + 2 &#8211; V$$.  In this case, there are 9 edges and 6 vertices, so $$F = 9 + 2 &#8211; 6 = 5$$, so the number of faces must be five.  We&#8217;ll come back to this fact in a bit.</p>
<div id="attachment_1641" class="wp-caption aligncenter" style="width: 192px"><img src="http://www.nomachetejuggling.com/files/k33_label.png" alt="" title="k33_label" width="182" height="122" class="size-full wp-image-1641" /><p class="wp-caption-text">Labeled K3,3</p></div>
<p>So what would it take to have a face in this graph?  How many edges would surround any given face?  Let&#8217;s say we start at some vertex, for example $$a$$.  We want to walk along edges from vertex to vertex and return to our starting vertex $$a$$.  If we can do this in a planar graph, we have a face (and remember, we&#8217;ve assumed the graph is planar).  What&#8217;s the smallest number of edges that can get us back to our starting point?</p>
<p>It can&#8217;t be one edge, because there are no loops.  And it can&#8217;t be two edges, because that would mean that there are two edges between two vertices, in other words a multi-edge, and we don&#8217;t have any of those either.  It also can&#8217;t be three edges, because after two edges we&#8217;re going to be back on the same side of the graph as our starting vertex, and we know those two don&#8217;t connect because the graph is bipartite.  For example, if you start at $$a$$, moving one edge away puts you at either $$f$$, $$e$$, or $$d$$.  Moving another edge away puts you at $$b$$ or $$c$$ and there&#8217;s no way to get back to $$a$$ with one more edge.  So no face can be surrounded by three edges.</p>
<p>The minimum number of edges needed to draw a face is four.  Four edges can get you back to the starting node, creating a face.  For example, $$a$$ to $$e$$ to $$b$$ to $$f$$ and back to $$a$$.</p>
<p>If there are at least four edges per face, then the total number of &#8220;face boundaries&#8221;, meaning the number of times an edge (any edge) is counted as the border of a face, is at least $$4F$$.</p>
<p>Any edge can only sit between two faces (since a face must use an entire edge and cannot use part of one).  Thus, each edge can only count twice as a face boundary, so there are at least $$\frac{4F}{2} = 2F$$ edges.</p>
<p>We know that $$F = 5$$ from earlier, which means the graph must have at least $$2*5 = 10$$ edges. $$E \ge 10$$, but we know that $$E = 9$$.  Thus we are left with $$9 \ge 10$$, which is obviously not true, so we&#8217;ve found a contradiction, Q.E.D.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/10/29/why-the-complete-bipartite-graph-k33-is-not-planar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Broke Your Code, And It&#8217;s Your Fault</title>
		<link>http://www.nomachetejuggling.com/2011/10/21/i-broke-your-code-and-its-your-fault/</link>
		<comments>http://www.nomachetejuggling.com/2011/10/21/i-broke-your-code-and-its-your-fault/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 22:57:53 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[attitudes]]></category>
		<category><![CDATA[professionalism]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1229</guid>
		<description><![CDATA[One of the most enjoyable parts of my last job was that we hired a lot of junior developers and interns. I really enjoy working with younger people than me, because they&#8217;re as eager to learn new things as I am. I also really enjoy discussing technical things with them, largely for selfish reasons: explaining [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most enjoyable parts of my last job was that we hired a lot of junior developers and interns.  I really enjoy working with younger people than me, because they&#8217;re as eager to learn new things as I am.  I also really enjoy discussing technical things with them, largely for selfish reasons: explaining something to someone else makes me understand that thing much better.</p>
<p>One particular intern on my old team was a lot of fun for me.  The company was the first place he worked since graduating with his B.S. in Computer Science.  The things he said were so similar to things I said when I first graduated, and his approaches to problems reminded me so much of my own approaches to problems eight years earlier that it bordered on creepy.</p>
<p>One particular exchange between him and I stood out in my mind.  It was exactly the conversation that 28-year-old me would have had with 20-year-old me.</p>
<dl class="chat-transcript">

<dt class="chat-highlight"><strong>Him:</strong></dt> <dd>Arggh, the other team changed the interface of something my code is using, and now it&#8217;s broken.</dd>
<dt><strong>Me:</strong></dt> <dd>So?  Just fix it.</dd>
<dt class="chat-highlight"><strong>Him:</strong></dt> <dd>I will, but it&#8217;s annoying.  I mean, if they had just started the application they would have seen it&#8217;s broken.  They&#8217;re so stupid.</dd>
<dt><strong>Me:</strong></dt> <dd>Wait, it breaks right away?</dd>
<dt class="chat-highlight"><strong>Him:</strong></dt> <dd>Yeah, you get an error when you hit the front page.  The front page!</dd>
<dt><strong>Me:</strong></dt> <dd>Then they aren&#8217;t the ones who are stupid.  We are.</dd>

</dl>

<p><span id="more-1229"></span></p>
<p>He was frustrated the other team had made a change and not even run the application.  They had checked code in without even giving it a run-through in the application live.  <strong>How unprofessional could you be?</strong></p>
<p>My answer?  A <em>lot</em> more unprofessional.  How?  By not creating any tests for your functionality.</p>
<p><img src="http://www.nomachetejuggling.com/files/JUnitRunner-300x235.gif" alt="" title="JUnitRunner" width="300" height="235" class="alignright size-medium wp-image-1599" /></p>
<p>The other team&#8217;s code immediately broke the entire application.  Yet, <strong>every single test in the commit suite passed</strong>.</p>
<p>The team that failed here was <strong>my</strong> team.  We had not created good test coverage, and the proof was in the pudding.  A change that completely crippled the application turned no tests red.  </p>
<p>Early in my career, I was afraid of making changes that could affect unexpected aspects of the system.  My first job out of college, whenever I made changes, I&#8217;d read lots of code and was extra careful.  Of course, nobody can ever be careful enough with this methodology, so I&#8217;d wind up breaking things.  I&#8217;d feel awful for this, completely embarrassed.  I&#8217;d panic and try to fix the code as quickly as possible, assuming my co-workers thought I was an idiot.</p>
<p>Today, I take the exact opposite approach: <strong>fearless refactoring</strong>.  I refactor code without even the slightest bit of concern about the ramifications.  If I break something, a test will let me know.  If no test lets me know when I broke something, I don&#8217;t feel embarrassed.  I feel like someone else should be embarrassed.</p>
<p><strong>If I break your code but all of the tests passed, it&#8217;s not my fault, it&#8217;s yours.</strong></p>
<p>I have unapologetically embraced this attitude, and I&#8217;m more than happy to share it with people.  If someone makes a change that breaks my code, I don&#8217;t give them hell for breaking my code, I thank them.  They found a part of my code that I had not correctly covered with a test.  Code coverage can only do so much, sometimes the only real way to know if you&#8217;re missing a test is for someone else to break your code in unexpected ways.</p>
<p><img src="http://www.nomachetejuggling.com/files/hudson-300x232.png" alt="" title="hudson" width="300" height="232" class="alignleft size-medium wp-image-1602" /></p>
<p>This attitude extends to deployments as well.  Just recently I was having a conversation with co-workers about whether it was safe to deploy some code that had a lot of changes in it (including mine).  Without even thinking, I said it was fine.  They looked at me like I was crazy.  How could I be so confident in the code without even looking at what anyone had written?  Simple: all of the tests were passing on the build.  <strong>I assume that all code with a passing build is deployable.</strong></p>
<p>Is it possible that I&#8217;m wrong?  Absolutely, there&#8217;s lots of undeployable code in the world that passes a build.  But deploying it and having it fail miserably is extremely valuable &#8211; the failure indicates a big area that needs to be covered by automated tests.  I&#8217;m happy to deploy code and have it fail spectacularly, it helps me know what tests need to be written.</p>
<p>I take the attitude that passing tests indicate the underlying code is perfect and, should I be proven wrong via failure, I immediately write tests to justify my attitude.</p>
<p>If you assume your code is right because the tests pass, and you are shocked every time that assumption is wrong (and respond appropriately), then after a short time your assumption will be true.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/10/21/i-broke-your-code-and-its-your-fault/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First World Problems: Blu-ray Woes</title>
		<link>http://www.nomachetejuggling.com/2011/10/07/first-world-problems-blu-ray-woes/</link>
		<comments>http://www.nomachetejuggling.com/2011/10/07/first-world-problems-blu-ray-woes/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 00:35:26 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Movies]]></category>
		<category><![CDATA[blu-ray]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1497</guid>
		<description><![CDATA[I used to have a huge collection of DVDs. For a few years, any time I saw a DVD of a movie I liked priced at under $10.00, I bought it. My DVD collection spanned 4 shelves, easily 300 movies. When it became clear to me that Blu-ray was going to win the HD format [...]]]></description>
			<content:encoded><![CDATA[<p>I used to have a huge collection of DVDs.  For a few years, any time I saw a DVD of a movie I liked priced at under $10.00, I bought it.  My DVD collection spanned 4 shelves, easily 300 movies.  When it became clear to me that Blu-ray was going to win the HD format war a few years ago, I sold nearly all of my DVDs on eBay, one by one.  I did this before Blu-ray was declared the official winner because I knew it would be hard to get decent prices for my DVD collection once DVDs were outdated, and I think it was the right move.</p>
<p>I&#8217;m slowly rebuilding my movie collection in Blu-ray, but the main difference between my Blu-ray collection and my DVD collection is that I intend for my Blu-ray collection to be limited.  Rather than buying the Blu-ray of every movie I like, I&#8217;m only buying the Blu-rays of the films I absolutely love.  Many of my DVDs were never watched after purchasing, a few of them were even sold on eBay without the cellophane removed.  New purchases are just my favorite films of all time (or at least related, which is why I own Terminator Salvation).</p>
<p><img src="http://www.nomachetejuggling.com/files/2011-10-06_18-50-09_498-580x325.jpg" alt="" title="2011-10-06_18-50-09_498" width="580" height="325" class="aligncenter size-large wp-image-1512" /><br />
<span id="more-1497"></span></p>
<h1 id="toc-the-last-physical-format">The Last Physical Format</h1>
<p>When I was buying DVDs, I knew they&#8217;d eventually be replaced.  I&#8217;ve owned movies on Betamax, VHS, and DVD.  No format ever felt like the &#8220;final&#8221; format.  I always knew I&#8217;d have to replace any movie with the next version of it at some point.  Blu-rays, however, don&#8217;t feel the same way.</p>
<p>I believe Blu-rays will be the last physical format of movies I ever buy.  It&#8217;s clear that the world is moving toward streaming or online storage of movies.  Maybe people will &#8216;rent&#8217; movies via Netflix or Amazon Instant or a similar service forever, or maybe there will be something more iTunes-like where you can &#8216;buy&#8217; movies and watch them any time.  There will be a day, eventually, when buying a film on physical media will seem like buying a CD today. </p>
<p>Between now and then, will anything replace Blu-ray?  I highly doubt it.  Blu-ray&#8217;s big improvement from DVDs was the enormous increase in resolution and quality.  Blu-ray is pretty maxed out in this regard &#8211; increasing resolution further would be virtually imperceptible to the human eye, so that won&#8217;t be the selling point of the next big thing.</p>
<p>The next big advance in film is probably going to be increasing the framerate.  But there&#8217;s no way to increase the framerate of older films the way we&#8217;ve been able to increase resolution for Blu-ray releases.  Any attempt to increase framerate would be done by interpolation, which could just as easily be done algorithmically on hardware.  With resolution, the data was fundamentally there already, in analog format on physical film, but framerate is fixed.  This all means that the next big format can&#8217;t use framerate as a selling point, because there&#8217;d be no incentive to buy older films.</p>
<p>Most good Blu-ray releases already have the absolute maximum amount of data associated with the film on-disc.  Every deleted scene, blooper reel, audition tape, and commentary ever recorded for a movie is usually on the Blu-ray release, having been dug-up from vaults as needed.  My Blu-ray of Blade Runner has five different versions of the film.  There&#8217;s literally nothing Blade-Runner related that could be unearthed to cram onto another release of the film.</p>
<p>For all of these reasons, I&#8217;m nearly certain that, when I got the Alien Quadrilogy on Blu-ray, it would be the very last time I purchased it (I owned the box set of 1-3 on VHS, then the quadrilogy box set on DVD).  I can imagine an occasional double-dip for some films (my copy of The Truman Show is pretty barebones, I could imagine a later release with more special features), but for the most part when I buy a Blu-ray, it&#8217;s meant to be the definitive, final version of the movie.  At least for me.</p>
<h1 id="toc-the-pressure-of-perfection">The Pressure of Perfection</h1>
<p>The unfortunate side-effect of this attitude toward Blu-ray is that it makes me unwilling to purchase Blu-rays that I don&#8217;t consider perfect.  <strong>When I buy a Blu-ray, I want to be buying, the final, definitive, essential edition of the film.</strong>  This has led to a Blu-ray collection that is sadly missing some of my favorite films.</p>
<h2 id="toc-predator">Predator</h2>
<p>As a simple example, one of my favorite action movies of all time is Predator.  I would love to own Predator on Blu-ray, but there are two versions of the film.</p>
<p>The first version, released in 2008, is a simple conversion from the DVD.  There&#8217;s not much in the way of visual upgrade, but even more importantly, virtually none of the extras from the Widescreen Collector&#8217;s Edition DVD (released 4 years earlier) are included.  The commentary, deleted scene, and extensive featurettes were all removed for the Blu-ray.  If I buy a Blu-ray, it needs to include the union of all possible special features from all DVD releases.  Thus, as much as I want to own it, I have to pass on Predator.</p>
<p>Another Blu-ray of Predator was released in 2010, the Ultimate Hunter Edition.  This version contains all of the extras the first Blu-ray should have had, porting over all of the content from the 2-disc DVD, and adding a few extra featurettes.  Unfortunately, the video itself has been given the Digital Noise Reduction treatment.  Digital Noise Reduction is an algorithm that attempts to remove graininess from low-quality source material &#8211; a lot of Blu-rays of older films are given the DNR treatment.  The problem is, Predator is <em>intentionally</em> grainy &#8211; shot with low light in the middle of the jungle, the graininess is part of what gives the film its organic look.  Applying DNR, especially with the dial turned up to 11, smooths out way too much.</p>
<p><img src="http://www.nomachetejuggling.com/files/predator_5-580x326.jpg" alt="" title="Carl Weathers" width="580" height="326" class="aligncenter size-large wp-image-1499" /></p>
<p>Look at Carl Weathers&#8217;s face.  He looks like a porcelain doll.  The scenes in the jungle are even worse.  I&#8217;d rather have the DVD transfer.</p>
<p>If I want the special features, I&#8217;d have to get Ultimate Hunter.  If I want the better video (which isn&#8217;t great either, but at least it&#8217;s not in plastic mode), I&#8217;d have to get the first Blu-ray.  I&#8217;m not willing to buy both because that annoys me on principle, so I&#8217;m stuck with neither of them.</p>
<h2 id="toc-the-thing">The Thing</h2>
<p>The Thing is one of the greatest pre-CGI special effects films ever made.  It&#8217;s the gold standard for makeup and effects in a pre-digital age, the movie against which I judge any other.  In addition, it&#8217;s a damn fine flick.</p>
<p><img src="http://www.nomachetejuggling.com/files/thething-300x128.jpg" alt="" title="thething" width="300" height="128" class="alignleft size-medium wp-image-1522" /></p>
<p>Unfortunately, the Blu-ray has had almost all of the extras from the DVD completely removed.  It retains the best feature, the absolutely phenomenal commentary with John Carpenter and Kurt Russell, but that&#8217;s about it.  Like with Predator, if I&#8217;m going to buy a Blu-ray, it needs all of the supplements from every DVD release, otherwise I feel like I&#8217;m not getting the real deal.</p>
<p>I have high hopes that the remake/reboot/prequel will motivate Universal to release a new edition of the Blu-ray with loads of extras, but I also worry that it might get the Predator treatment and have the excellent visual transfer altered.  </p>
<p><strong>UPDATE</strong>: While researching if The Thing would get a re-release with the remake&#8217;s release, I discovered that the <a href="http://www.amazon.co.uk/The-Thing-Blu-ray-Region-Free/dp/B001DD0DAK/">UK version of the The Thing Blu-ray</a> actually has all of the special features restored, including the phenomenal documentary (which was previously cut to shreds for a Picture-In-Picture exclusive feature on the US Blu-ray).  The disc is region free, and it played just fine in my Blu-ray player.  As advertised, it has all of the special features as well as a beautiful high-def video transfer.  It also came in a much, much nicer case (with slipcover) than the picture on Amazon implied.  Really nice, very happy with it.  If you like The Thing, that&#8217;s the one to get.</p>
<h2 id="toc-commando">Commando</h2>
<p>Schwarzenegger just can&#8217;t get any love in Blu-ray.</p>
<p><img src="http://www.nomachetejuggling.com/files/commando7-300x150.jpg" alt="" title="commando7" width="300" height="150" class="alignright size-medium wp-image-1524" /></p>
<p>Commando was the first action film I ever loved.  I taped it off HBO and played it so much that it wore the tape out.  Every month when the little &#8220;HBO This Month&#8221; booklet arrived in the mail, I&#8217;d look to see if Commando was airing that month so I could tape it again.  </p>
<p>In 2007, the Director&#8217;s Cut of the film was released on DVD, complete with an audio commentary, some deleted scenes, and a couple featurettes.  So can someone please explain why the only Blu-ray version of this awesome one-liner-fest is the theatrical version only and contains only a single special feature, <em>the trailer</em>?  Fuck you, Fox.</p>
<h2 id="toc-lord-of-the-rings">Lord of the Rings</h2>
<p>I would also love to own Lord of the Rings.  The films are shot majestically, with wide sweeping landscapes and fantastic visuals.  They&#8217;re perfect for Blu-ray.</p>
<p>There are two sets of Blu-rays.  The first set is the regular theatrical editions, with many of the special features from the best versions of the DVDs removed.  Screw that.</p>
<p>Recently, a the Extended Editions were finally released on Blu-ray in a beautiful boxed set, absolutely loaded with extras.  I really want to buy it, but I&#8217;m unwilling to do so for one simple reason.</p>
<p>Here is a shot from the theatrical edition of the film on Blu-ray.  This transfer is of much lower quality than the Extended Edition Blu-ray in terms of resolution and clarity, but what we really want to look at here is the color.</p>
<p><img src="http://www.nomachetejuggling.com/files/lotrtheatrical-e1317961134583-580x236.png" alt="" title="LOTR Theatrical" width="580" height="236" class="aligncenter size-large wp-image-1505" /></p>
<p>And here is the same shot, from the Extended Edition Blu-ray:</p>
<p><img src="http://www.nomachetejuggling.com/files/lotrextended-e1317961214255-580x236.png" alt="" title="lotrextended" width="580" height="236" class="aligncenter size-large wp-image-1506" /></p>
<p>This is somewhat infamous for both Lord of the Rings fans and film aficionados.  What&#8217;s particularly disturbing is that this green/blue color-tinting ONLY applies to Fellowship of the Ring.  The Two Towers and Return of the King are both fine.  It seems incredibly clear to me that this was an error in the transfer.  The right thing to do is issue replacement discs after fixing the glitch.</p>
<p>Unfortunately, New Line&#8217;s attitude is that the colors are correct and <a href="http://www.thedigitalbits.com/reviewshd/bdreviews061411.html">Peter Jackson approves of them</a>.  Like I said, this is obviously a glitch, but instead of taking responsibility and fixing it, they&#8217;re claiming it&#8217;s meant to be this way.</p>
<div id="attachment_1509" class="wp-caption aligncenter" style="width: 590px"><img src="http://www.nomachetejuggling.com/files/fellowgreen-580x178.jpg" alt="" title="Fellowship of the Green" width="580" height="178" class="size-large wp-image-1509" /><p class="wp-caption-text">Fellowship of the Green</p></div>
<p>I&#8217;m not interested in owning the box set of the theatrical editions, but I&#8217;ll never watch Fellowship of the Rings if I feel like I&#8217;m watching it through snot-covered glasses the whole time.  Once again, another amazing Blu-ray I&#8217;m unwilling to purchase.</p>
<p><b>UPDATE</b>: I borrowed a copy of these films from a friend to see for myself if I found it annoying.  There is definitely a green tint to many scenes in the film, but not the entire film, which leads me to believe it was intentional for those scenes.  Most of the time the green is within the Hobbit village, and the earthy tones fit there.  There were a few scenes where the green didn&#8217;t quite seem appropriate, but I had to really be looking for them.  Overall, the green is subtler than a lot of the screenshots above imply, and it was never distracting, nor did it affect my enjoyment of the film.  It&#8217;s not ideal, but the Blu-ray is such excellent quality that it&#8217;s ignorable, so I&#8217;ve decided to get this set after all.</p>
<h2 id="toc-star-wars">Star Wars</h2>
<p>I would love to own Star Wars on Blu-ray, but I can&#8217;t do it for one particular reason.</p>
<p>First off, let me make something clear: I&#8217;m not a Star Wars purist.  I&#8217;m not looking to get the theatrical editions or anything &#8211; I actually don&#8217;t mind a lot of George Lucas&#8217;s changes.  A lot of the changes made to the original releases over the years have been vast improvements.  The opening crawl re-rendering, the cleanup on matte outlines, the color fixes for lightsabers.  All of it vastly improves the appearance of the aging films.</p>
<p><img src="http://www.nomachetejuggling.com/files/cloudcity-300x128.jpg" alt="" title="cloudcity" width="300" height="128" class="alignleft size-medium wp-image-1532" /></p>
<p>I even don&#8217;t mind a lot of the more invasive cosmetic differences that others complain about.  The digital Dewbacks in New Hope, even the extra CGI garbage in Mos Eisley, all of it serves to better illustrate the size and scope of the organic life on the planets.  The digital erasing of walls in Cloud City to show the sky in the background does a much better job of illustrating the nature of the city. Ian McDiarmid&#8217;s Emperor insert is a vast improvement over the original in Empire; the whole &#8220;<a href="http://www.omg-facts.com/view/Facts/44011">superimposed chimpanzee eyes</a>&#8221; thing never looked right to me, I could never tell if the original Emperor had eyes or if I was looking at something behind him.  I don&#8217;t even care about the most recent addition of Ewok blinking.  Let the little fuckers blink.</p>
<p>I even prefer the special edition ending of Return of the Jedi.  Specifically, I always felt that the stupid Ewok song was a complete anticlimax.  The special edition cuts to various planets celebrating the fall of the Empire.  There&#8217;s even a scene on Coruscant where the citizens topple a giant statue of the Emperor.  These scenes are an <b>enormous</b> improvement over the original ending.  The film still ends at a personal level, with Luke seeing his father with Obi-Wan and Yoda, but it also conveys the sheer immensity of the accomplishment across the galaxy, and it nails the celebratory tone.</p>
<p><img src="http://www.nomachetejuggling.com/files/coruscant2004b-580x249.jpg" alt="" title="coruscant2004b" width="580" height="249" class="aligncenter size-large wp-image-1534" /></p>
<p>These changes are all <b>cosmetic-only</b>.  They don&#8217;t change the story in any appreciable way.  The story and characters from the original versions of the film are completely preserved by these changes &#8211; the films simply look better.</p>
<p>There are some changes, however, where this is not the case.  These changes actually alter the story of the film, and as a result I hate them, because they&#8217;re not merely better-looking versions of the same movies, but are in fact slightly different movies.</p>
<ul>
<li><b>Greedo Shooting First</b> &#8211; Yeah, yeah, everyone hates this change.  When Han shot first in the original, it illustrated he was a rogue character.  It showed his primary focus was his own self-preservation and survival.  George didn&#8217;t like this because it made Han look like kind of a dick.  But that&#8217;s exactly the point: Han <b>is</b> kind of a dick at the beginning of A New Hope.  Over the course of the film, because of the experiences of the film, he comes to see value in things bigger than himself.  Rather than flying away from the attack on the Death Star, he comes back and saves Luke.  His character completely changes over the course of the film, but having him shoot only in defense ruins his arc.  Not to mention no version of his double-joined neck seems to look right.  The Blu-ray actually improves this by having Greedo and Han shoot almost simultaneously, but it&#8217;s still dumb.</li>
<li><b>Jabba&#8217;s Visit</b> &#8211; After the Greedo scene, Jabba the Hutt confronts Han.  This scene is absolutely idiotic.  <div id="attachment_1516" class="wp-caption alignright" style="width: 190px"><img src="http://www.nomachetejuggling.com/files/Jabba.jpg" alt="" title="Jabba" width="180" height="217" class="size-full wp-image-1516" /><p class="wp-caption-text">This looks like a turd.</p></div>  First of all, Greedo JUST said that he was basically there to collect the bounty on Han.  If Jabba can just waddle his ass over to Han whenever he pleases, why did he hire a bounty hunter?  And why is Jabba, who ruthlessly murdered people in Jedi, so nice toward Han, a smuggler who dumped his shipment?  Jabba even tolerates Han stepping right on his tail.  This is the same Jabba that kept a man encased in carbonite on his wall?  Totally changes the character, making a major villain into a cuddly comic foil.  Not an acceptable change.</li>
<li><b>Hayden Christensen</b> &#8211; One of the most offensive changes is the replacing of actor Sebastian Shaw with Hayden Christensen for the ending of Jedi.  This changes a huge aspect of character and story.  When Vader dies, then shows up as Sebastian Shaw, it&#8217;s clear that he was able to become a Force Ghost because he had been redeemed, coming back to the side of good before death, thanks to his son Luke.  When Christensen appears, the message is that Vader died <b>still evil</b>, so his younger self was the last &#8220;good&#8221; version of him.  This means Luke partially failed to redeem his father.  This completely alters the message of the ending, and is an awful change.  Why the hell does Luke even recognize him?</li>
</ul>
<p><strong>UPDATE</strong>: I watched the new Blu-Ray version of Star Wars and I found the whole &#8220;Han Shooting First&#8221; issue to be much improved.  The time between the two shots is so reduced and the entire scene compressed to so few frames that, even as I watched it in slow-motion, I could barely tell who actually shot first.  It&#8217;s not as good as Han clearly shooting first, but it&#8217;s tolerable.  I no longer consider that an objection to the special edition.</p>
<p>Those <del datetime="2011-10-15T20:10:04+00:00">three</del> two changes are my most hated of all of the changes (except one, more on that in a second).  If those were fixed, I&#8217;d happily take all of the other changes without complaint.  But why do they stop me from buying the Blu-ray?  After all, those changes were introduced in the DVD versions, which I own.</p>
<p>No, my problem with the Blu-ray comes down to a single scene, exclusive to it.  I&#8217;m way, way too bothered by Vader <a href="http://popwatch.ew.com/2011/08/31/return-jedi-darth-vader-nooooo/">yelling &#8220;NOOOO&#8221; as he kills the Emperor</a>.</p>
<p>My favorite moment in all of Star Wars is when Vader kills the Emperor.  Seeing Vader watch his son being electrocuted, then coming back to the side of good, saving his son and simultaneously destroying the Empire and saving the galaxy, is something that makes my eyeballs just a tad moist every time.  The feeling of elation I get when I watch that scene is unmatched by any other scene in the series.</p>
<p>It needed to be left completely alone.  It was perfect and powerful.  Adding Vader screaming &#8220;NO!&#8221; serves to undercut the drama of the scene, as well as remind me of the inferior prequel trilogy.  I could never, <b>ever</b> watch an altered version of that scene and have the same joyful reaction I&#8217;ve had to it every time I&#8217;ve watched it since I was young.  This relatively minor tweak ruined my favorite scene in the entire trilogy.</p>
<p>I know it&#8217;s nitpicky to refuse to buy a gorgeous Blu-ray boxed set simply because of 2 seconds of additional audio, but when it&#8217;s my favorite 2 seconds of the entire series, I don&#8217;t think it&#8217;s that unreasonable.  It also really irritates me that Lucas would even make such a drastic alteration to a movie that <b>he didn&#8217;t even direct</b>.  In fact, the original director is dead, so he can&#8217;t even tell George what a dipshit he&#8217;s being.  It&#8217;s disrespectful.</p>
<p>In any case, I can&#8217;t buy the Blu-ray boxed set of Star Wars, as much as I&#8217;d like to own it, because of this change.</p>
<h2 id="toc-other-movies">Other Movies</h2>
<p>I&#8217;m stunned that, at this point, there are no Blu-ray releases of the following films:</p>
<ul>
<li><b>The Abyss</b> &#8211; In a way, James Cameron&#8217;s best movie, because its anti-war message make it clear he&#8217;s <a href="http://www.collativelearning.com/aliens%20-%20the%20antidote%20sequel.html">not just some gun-loving douchebag</a>, which greatly improves his other films.</li>
<li><b>WarGames</b> and <b>Sneakers</b> &#8211; Two of the best geek-movies ever made.  Perfectly capturing the state of technology in the 80&#8242;s and 90&#8242;s, respectively, and using it to deliver forward-thinking messages.  Science fiction that isn&#8217;t about aliens or spaceships.  Both of these films are lightning in a bottle for me.</li>
<li><b>Being John Malkovich</b> &#8211; Enjoyable both as a purely surface-level zany comedy and as a deeply introspective philosophical exploration.  One of my favorite comedies.</li>
<li><b>Bill and Ted&#8217;s Excellent Adventure</b> &#8211; I can&#8217;t possibly justify liking this movie, but I do.</li>
<li><b>True Lies</b> &#8211; I liked Schwarzenegger movies a lot growing up, okay?  Fuck you, this list is over.</li>
</ul>
<h1 id="toc-my-sad-collection">My Sad Collection</h1>
<p>If I could own the definitive version of every film I love in Blu-ray, I&#8217;d be one happy little boy inside of a man&#8217;s body.  But while double-dipping seems possible for Commando and The Thing, it&#8217;s looking decreasingly likely I&#8217;ll ever see an unmolested version of Star Wars or a color-corrected Lord of the Rings.  In some cases I think it&#8217;s just film studios being lazy, but Peter Jackson and George Lucas maintain an inordinate amount of control over their films, so I think it&#8217;s really sad that they refuse to satisfy the very fans that made their films successful in the first place.  Lucas is a particularly bad offender, as each version of Star Wars he releases seems to be, on the whole, worse than the last version.</p>
<div id="attachment_1529" class="wp-caption aligncenter" style="width: 590px"><img src="http://www.nomachetejuggling.com/files/swrocks-580x245.jpg" alt="" title="swrocks" width="580" height="245" class="size-large wp-image-1529" /><p class="wp-caption-text">Star Wars: Now With 50% More Rocks!</p></div>
<p>Back when I was unsatisfied with the DVD release of a movie, I could hold out hope that when DVD was replaced by something, the film would be released again in an edition I could happily purchase.  But since I think Blu-ray is the last physical format for film, that means I won&#8217;t merely be passing on one version of a film&#8217;s release, but I will, in fact, never own it at all.  That means I&#8217;ll never be able to pop some of my favorite movies in to show my kids, and never be able to experience a classic from a fresh perspective by sharing it with someone else.</p>
<p>Why are studios half-assing it with the format that they themselves herald as the ultimate movie-collector&#8217;s dream?</p>
<p>Blu-ray, I am disappoint.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/10/07/first-world-problems-blu-ray-woes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Magic Variables Aren&#8217;t Always Magic</title>
		<link>http://www.nomachetejuggling.com/2011/09/27/magic-variables-arent-always-magic/</link>
		<comments>http://www.nomachetejuggling.com/2011/09/27/magic-variables-arent-always-magic/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 22:01:55 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[discipline]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[practices]]></category>
		<category><![CDATA[rules]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1006</guid>
		<description><![CDATA[Software development is a strange beast sometimes. Despite the fact that it is not predictable enough or constant enough to qualify as true engineering, it&#8217;s often referred to as Software Engineering anyway. There are no rules in software development. Some suggest the existence of best practices, but really there are only guidelines and recommendations. Despite [...]]]></description>
			<content:encoded><![CDATA[<p>Software development is a strange beast sometimes.  Despite the fact that it is <a href="http://www.artima.com/intv/garden.html">not predictable enough</a> or <a href="http://www.cs.usfca.edu/~parrt/doc/software-not-engineering.html">constant enough</a> to qualify as true engineering, it&#8217;s often referred to as Software Engineering anyway.</p>
<p>There are no rules in software development.  Some suggest the existence of <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0306_perks/perks2.html">best practices</a>, but really there are only guidelines and recommendations.</p>
<p>Despite these truths, there are a number of alleged &#8220;rules&#8221; in software development, often suffixed with &#8220;<a href="http://en.wikipedia.org/wiki/Considered_harmful">considered harmful</a>&#8221; as a reference to Edsger Dijkstra&#8217;s famous &#8220;<a href="http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF">Go To Statement Considered Harmful</a>&#8221; essay.  I want to look at one of these rules a bit more closely.<br />
<span id="more-1006"></span></p>
<h1 id="toc-magic-constants-considered-harmful">Magic Constants Considered Harmful</h1>
<p>&#8220;Magic Constants,&#8221; also often referred to as &#8220;Magic Numbers&#8221; break what is regarded as one of the oldest &#8220;rules of programming&#8221;, dating back as far as the manuals for COBOL and FORTRAN in the 60&#8242;s.</p>
<p>Magic Numbers are numbers that are used and re-used in code.</p>
<pre class="brush: cpp; gutter: false;">
salePrice = 0.90 * regularPrice;
</pre>
<p>Above is a simple example.  The usage of <code>0.90</code> is generally regarded as bad.  Instead it should be replaced with something like this:</p>
<pre class="brush: cpp; gutter: false;">
const double DISCOUNT_PERCENT = 10;
const double DISCOUNT_FACTOR = 1 - (DISCOUNT_PERCENT / 100);

// ...

salePrice = DISCOUNT_FACTOR * regularPrice;
</pre>
<p>It&#8217;s hard to argue with this reasoning.  The second code snippet is easier to read and easier to modify.  In this case, this seems like a no-brainer.  This is how &#8220;rules&#8221; are created.</p>
<h1 id="toc-why-is-it-harmful">Why Is It Harmful?</h1>
<p>A lot of times, once a best practice or a rule becomes codified in the industry, it stops being questioned.  The <b>why</b> is forgotten over time, and it just becomes a rule that everyone follows blindly.  Sometimes it&#8217;s helpful to remind ourselves of the reasons for a best practice, to avoid becoming <a href="http://en.wikipedia.org/wiki/Cargo_cult_programming">Cargo Cult Programmers</a>.</p>
<p>Why is the first code snippet bad?  </p>
<ol>
<li><b>It has no name</b> &#8211; It&#8217;s not immediately clear to the reader of the code why the 0.90 is there.  The variable <code>salePrice</code> gives a good hint, but it takes a bit of inferring.  The second snippet labels the value clearly as <code>DISCOUNT_FACTOR</code>, which is much clearer.</li>
<li><b>It&#8217;s reused</b> &#8211; Though not directly reused in the example, it&#8217;s easy to imagine repeated usages of the <code>0.90</code> value.  This repetition is less than ideal, particularly because&#8230;</li>
<li><b>It can change</b> &#8211; If we start offering a 15% discount instead of a 10% discount, we&#8217;d have to find every usage of <code>0.90</code> and replace it with <code>0.85</code>.  It&#8217;s much easier to change it in just the one place.</li>
</ol>
<h1 id="toc-dont-go-overboard">Don&#8217;t Go Overboard</h1>
<p>Not too long ago, I came across some code that made me realize that this rule is perhaps followed to the letter without being followed in spirit.</p>
<p>The code has been slightly modified to protect the guilty.</p>
<pre class="brush: java;">
class Example {
  private static final String FORWARD_SLASH=&quot;/&quot;;

  public String getUrlPath() {
    return FORWARD_SLASH + &quot;books&quot; + FORWARD_SLASH + &quot;all&quot;;
  }
}
</pre>
<p>When I first came across this code, my instinct was to replace it with a simple</p>
<pre class="brush: java; first-line: 5;">
    return Joiner.on(FORWARD_SLASH).join(&quot;books&quot;, &quot;all&quot;);
</pre>
<p>This seemed so reasonable to me at first, plus I get a nerdection every time I get to use anything in <a href="http://code.google.com/p/guava-libraries/">Google Guava</a>.</p>
<p>But then I thought about it.  This is following the letter of the &#8220;don&#8217;t use Magic Constants&#8221; rule, but is it following the spirit of it?</p>
<p>The <code>"/"</code> has been extracted to a constant, so now it has a name.  But is the name descriptive?  No, the name is simply <code>FORWARD_SLASH</code>, which is about as descriptive as if in the first example we had simply done <code>const double POINT_NINE_ZERO = 0.90;</code>.</p>
<p>The constant is clearly being used as part of an HTTP request of some type, so how likely is it that the next version of HTTP would use a new character for path separation?  It&#8217;s beyond unlikely, so the fact that this constant is easy to change doesn&#8217;t seem to buy anything.</p>
<p>It&#8217;s also significantly more to type and read. <code>return "/books/all"</code> is 35 fewer characters and much easier to read.</p>
<p>So what about when the constant is reused?  That&#8217;s actually the most significant problem of all.</p>
<p>Imagine a second class, <code>Example2</code>:</p>
<pre class="brush: java;">
public class Example2 {
  private static final String FORWARD_SLASH = &quot;/&quot;;

  public String getPath() {
    return FORWARD_SLASH + &quot;directory&quot; + FORWARD_SLASH + &quot;file.txt&quot;;
  }
}
</pre>
<p>Someone may notice the repeated constant and pull them both into a <code>Constants</code> class, using <code>Constants.FORWARD_SLASH</code> in both <code>Example</code> and <code>Example2</code>.</p>
<p>Now we&#8217;re really guarding against change.  If that changes, we can fix both classes by changing only <code>Constant</code>!</p>
<p>Except, now you&#8217;re really screwed.  Even on the off-chance that HTTP changes its path separator character, or in the more likely case that you move your deployment environment from Unix to Windows, you haven&#8217;t saved yourself any time.  Why?  <b>Because these won&#8217;t both change at the same time</b>.</p>
<p>If that happened happened, you&#8217;d have to re-split the usages of these constants so that you were only changing, say, the file path separators but not the URL path separators.  You actually have to modify even more code, not less.  It would be far easier to have used <code>"/"</code> in both files, then done a simple regex replace on the relevant files in the unlikely event that the character had to change.</p>
<h1 id="toc-dont-follow-rules-blindly">Don&#8217;t Follow Rules Blindly</h1>
<p>The code example I&#8217;ve provided wasn&#8217;t made up for the post, it&#8217;s real.  That means that some of my peers felt like it would be bad code to have simply used the forward slash character inline.  There&#8217;s no way around it, this comes from internalizing rules without internalizing reasons.</p>
<p>I don&#8217;t mention this code because I&#8217;m specifically bothered by overuse of the &#8220;Extract Constant&#8221; IntelliJ shortcut, or because I want to pick on old co-workers (though it is fun).  I mention it because, for me, it exemplifies the danger (and hilarity) of following &#8220;rules&#8221; without giving them due consideration.</p>
<p>Any time you find yourself doing something because it&#8217;s the &#8220;right&#8221; way, stop and make sure you understand the reasons for that best practice.  Take two seconds and make sure those reasons still apply, otherwise you&#8217;ll wind up writing code that might embarrass you later on.</p>
<p>Your code should strive to maximize readability and maintainability.  If that goal is at odds with the occasional &#8220;rule&#8221;, break the rule.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/09/27/magic-variables-arent-always-magic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving One Git Repository Into Another As A Subdirectory</title>
		<link>http://www.nomachetejuggling.com/2011/09/12/moving-one-git-repo-into-another-as-subdirectory/</link>
		<comments>http://www.nomachetejuggling.com/2011/09/12/moving-one-git-repo-into-another-as-subdirectory/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 22:15:30 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1484</guid>
		<description><![CDATA[I recently had to merge a number of independent projects into a larger project to enable a long-term project reorganization effort. Since we&#8217;re using Git for both projects, this was quite easy, but it required some investigating to figure out how to do it. So you have two projects, old-project and new-project. You want to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to merge a number of independent projects into a larger project to enable a long-term project reorganization effort.  Since we&#8217;re using Git for both projects, this was quite easy, but it required some investigating to figure out how to do it.</p>
<p>So you have two projects, <code>old-project</code> and <code>new-project</code>.  You want to end up with a subdirectory inside of <code>new-project</code> called <code>old-project</code> with all of the code from <code>old-project</code>, and you want to preserve that project&#8217;s history.</p>
<p>For the purposes of this demonstration, <code>old-project</code> is cloned at <code>/home/machete/old-project</code> and <code>new-project</code> is cloned at <code>/home/machete/new-project</code>.</p>
<p>At the end of this, we want there to be a <code>/home/machete/new-project/stuff/old-project</code> with all of the commits from <code>old-project</code> intact.</p>
<p><span id="more-1484"></span></p>
<p>The way we&#8217;re going to do this, it&#8217;s going to completely overlay <code>old-project</code> on top of <code>new-project</code>, so first we need to adjust the directories inside of <code>old-project</code></p>
<pre class="brush: bash;">
cd /home/machete/old-project
mkdir -p ../stuff/old-project
mv * .gitignore ../stuff/old-project
mv ../stuff .
git commit -a -m &quot;Preparing old project for move&quot;
</pre>
<p>This just moves all of the files in <code>old-project</code> into a subdirectory structure matching what we want to have inside of <code>new-project</code>, then makes a commit.</p>
<p>Next we need to copy the history of this repository into <code>new-project</code>.  So we don&#8217;t have to push our temporary move anywhere, we&#8217;re going to add our local directory as a remote git repository, then pull its changes in.</p>
<pre class="brush: bash;">
cd /home/machete/new-project
git remote add temp file:///home/machete/old-project
git pull temp master
git remote rm temp
</pre>
<p>This pulls the entirety of old-project&#8217;s history in.  Since we did a pull (a fetch and then a merge), we will have a new commit at HEAD that has two parents, one for the regular <code>old-project</code> codeline, and one for the old <code>new-project</code> codeline.</p>
<p>That&#8217;s it, you can push <code>new-project</code> anywhere and the next fetch will pull down all of <code>old-project</code>&#8216;s history.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/09/12/moving-one-git-repo-into-another-as-subdirectory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mechanics of Good Pairing</title>
		<link>http://www.nomachetejuggling.com/2011/08/25/mechanics-of-good-pairing/</link>
		<comments>http://www.nomachetejuggling.com/2011/08/25/mechanics-of-good-pairing/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 23:50:44 +0000</pubDate>
		<dc:creator>Rod Hilton</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[pairing]]></category>
		<category><![CDATA[team]]></category>

		<guid isPermaLink="false">http://www.nomachetejuggling.com/?p=1380</guid>
		<description><![CDATA[I&#8217;ve made no secret about the fact that I Love Pair-Programming. I&#8217;ve tried pair programming with a number of different setups, each one better than the last. I&#8217;ve had a lot of people ask me about how best to set up pair-programming environments at work, so I&#8217;m going to take you through a number of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made no secret about the fact that <a href="http://www.nomachetejuggling.com/2009/02/21/i-love-pair-programming/">I Love Pair-Programming</a>.  I&#8217;ve tried pair programming with a number of different setups, each one better than the last.</p>
<p>I&#8217;ve had a lot of people ask me about how best to set up pair-programming environments at work, so I&#8217;m going to take you through a number of different ways to pair-program and discuss the advantages of each.</p>
<h1 id="toc-level-1-not-pairing">Level -1: Not Pairing</h1>
<p>The first level of pairing is something I see surprisingly often.  An inside-corner desk, typically an individual&#8217;s workstation.  Another person scoots their chair over and leans in, looking at the same monitor.</p>
<p><img src="http://www.nomachetejuggling.com/files/level-1.png" alt="" title="level-1" width="462" height="359" class="aligncenter size-full wp-image-1387" /></p>
<p>It seems like no coincidence that virtually everyone I&#8217;ve seen &#8220;pair program&#8221; this way dislikes pairing.  That&#8217;s because this setup is not actually pairing.  It&#8217;s just coding with someone watching over your shoulder.</p>
<p>Nobody likes having someone read over their shoulder, let alone read code they are writing.  This set-up basically ensures that the person writing the code (the driver) and person thinking about the next steps (the navigator) never trade places.  Trading places involves not merely sliding a keyboard over, but actually scooting rolling chairs out of the way, so it never happens.</p>
<p>Just as importantly, the two programmers are not the same distance from the monitor.  The monitor &#8220;belongs&#8221; to the person sitting closest to it, so the other person is really just watching.  The navigator will probably just zone out and think about something else while the driver codes away, confident that their pairing partner is helping ensure they don&#8217;t make mistakes.</p>
<p>This kind of pairing is a waste of time.  Corner desks are the office furniture from hell.  Put it in a cubicle so that it&#8217;s basically impossible for two people to fit and you&#8217;ve essentially ensured that nobody on your team will ever pair program.<br />
<span id="more-1380"></span></p>
<h1 id="toc-level-0-basic-pairing">Level 0: Basic Pairing</h1>
<p>The first level of actual pairing is simple.  A rectangular desk with two people sitting at it, sharing a computer.</p>
<p><img src="http://www.nomachetejuggling.com/files/level0.png" alt="" title="level0" width="462" height="359" class="aligncenter size-full wp-image-1390" /></p>
<p>The great advantage to this setup is that it&#8217;s free.  As long as you don&#8217;t make the mistake of filling your development area with corner desks, all that needs to happen here is have a second person scoot up to another person&#8217;s workstation.</p>
<p>The two developers need to make sure they sit equidistant from the monitor so that neither person &#8220;owns&#8221; the machine and both people feel like they can grab the keyboard at any time.  If this is one person&#8217;s workstation that&#8217;s been re-appropriated as a pairing machine temporarily, the normal user of it may be more likely to hog the keyboard, so it&#8217;s important to be careful to avoid that.</p>
<p>One of the problems of this set up is that it&#8217;s probably not a devoted pairing machine.  This means that the environment will be configured for the workstation&#8217;s usual user.  Keyboard bindings, IDE color schemes, fonts, installed programs, and so on won&#8217;t be what a pair agreed to use, but what a single person prefers.  The person who scooted over may feel like a fish out of water in an unfamiliar environment, leading to another situation where one person is doing all of the driving.   </p>
<p>One way to help this problem is for the owner of the workstation to make a second user on the workstation, with its own desktop.  Most operating systems make it easy to switch between users these days, so having a regular user and a pair user that can be switched into easily is nice.  The only problem is that, of course, sharing information between users is difficult, so it may be hard if there is already work-in-progress when the pairing starts.  </p>
<p>At least this is better than the previous level, since both people can see the monitor equally well.</p>
<h1 id="toc-level-1-good-pairing">Level 1: Good Pairing</h1>
<p>At the next level, we add a second keyboard and a mouse.  Each programmer has his or her own input device set, but the programmers share a monitor.</p>
<p><img src="http://www.nomachetejuggling.com/files/level1.png" alt="" title="level1" width="462" height="359" class="aligncenter size-full wp-image-1397" /></p>
<p>This is good because it&#8217;s easy to upgrade an existing workstation.  All you need to buy is another keyboard and mouse, both of which are generally dirt cheap.</p>
<p>This empowers both developers to feel like they &#8220;own&#8221; the machine, and they can feel free to take control and write code without any ceremony whatsoever.  Because of the setup, it nearly forces people to sit equidistant to the monitor, further aiding in the sense that both programmers have equal right to code at the machine.</p>
<p>One con of this setup is that there are sometimes &#8220;mouse wars&#8221; &#8211; two people using their mice simultaneously and causing problems.  This doesn&#8217;t happen all that often and a little communication resolves it quickly, so it&#8217;s easy to move past.</p>
<p>Another problem with this set up is that a lot of mice these days are bluetooth, particularly on Macs.  OS X has given me a lot of trouble with two identical bluetooth mice connecting to it simultaneously, it&#8217;s much easier to use a wired mouse.</p>
<p>The biggest win here is that the machine stops seeming like it&#8217;s a single developer workstation.  Even when only one person is at it, it &#8220;feels&#8221; like a devoted pairing machine because there is an extra keyboard and mouse at the machine.  This makes people less likely to apply strange customizations that alienate other programmers.</p>
<p>Finally, the biggest problem with this set up is that, because it forces people to sit equidistant to the monitor, both programmers may find that the monitor is actually too far away from them.  Increasing the font size in the editor helps this greatly, but it still can lead to eyestrain.  Large monitors are very helpful here.</p>
<h1 id="toc-level-2-great-pairing">Level 2: Great Pairing</h1>
<p>At the next level, you add a second monitor to the machine.  These monitors are mirrored, which can be done with either software or <a href="http://www.amazon.com/Cables-Unlimited-DVI-D-Splitter-PCM-2260/dp/B000H09RFM">DVI splitters</a>.</p>
<p><img src="http://www.nomachetejuggling.com/files/level2.png" alt="" title="level2" width="462" height="359" class="aligncenter size-full wp-image-1396" /></p>
<p>Both programmers feel equal control over the machine, and there are no eyestrain problems.  This is a really pleasant pairing situation, and it only adds the cost of a keyboard, mouse, and extra monitor to a regular workstation.</p>
<p>One common problem is that developers, rather than mirroring the desktop on both monitors, may want simply expand the desktop to both monitors.  This is a mistake.  The main IDE will be on only one of these monitors, and whoever is sitting at that monitor will eventually become the permanent driver and you&#8217;re in a situation no better than the Level -1 setup.  This is even worse on OS X, where even the menu bar &#8220;belongs&#8221; to only one of the monitors (though this can be somewhat <a href="http://blog.boastr.net/?page_id=79">fixed</a>).</p>
<p>The other problem is that the desk can get pretty cramped, particularly for the person the left side, since their mouse may be constantly hitting the keyboard of the person to their right.</p>
<h1 id="toc-level-3-awesome-pairing">Level 3: Awesome Pairing</h1>
<p>The cramped problem can be solved by simply adding an extra desk.  But rather than pushing them next to each other, push them perpendicular to each other.</p>
<p><img src="http://www.nomachetejuggling.com/files/level3.png" alt="" title="level3" width="462" height="359" class="aligncenter size-full wp-image-1399" /></p>
<p>In addition to giving each developer plenty of space to move around and be comfortable, this sets up both programmers to actually FACE each other while working together by only slightly turning their heads.</p>
<p>Setting up pairing in this way makes a very noticeable difference right away.  Switch a pair from Level 2 to Level 3 and you&#8217;ll notice them talking a LOT more.  Developers will discuss design, bounce ideas off each other, and generally collaborate much better, simply because they are facing each other.</p>
<p>This setup takes up quite a bit of room and it looks a little silly, but it is absolutely fantastic.  It leaves room for sticky notes, pens, a developer&#8217;s tablet or laptop, and lots of other things.  The entire setup &#8216;feels&#8217; like a pairing station, and it works exceptionally well.</p>
<p>There aren&#8217;t really any problems with this setup, though there is one way it could be better&#8230;</p>
<h1 id="toc-level-4-pair-adise-ha">Level 4: &#8220;Pair&#8221;-adise (ha!)</h1>
<p>Give the pair an extra laptop to share, put it between the programmers.</p>
<p><img src="http://www.nomachetejuggling.com/files/level4.png" alt="" title="level4" width="462" height="359" class="aligncenter size-full wp-image-1400" /></p>
<p>Often the navigator may want to look something up on Google or StackOverflow, but doesn&#8217;t want to take the driver off his current task to do so.  Having a laptop sitting between the programmers allows either one of them to shift away from the code to look things up or even try things out in a REPL environment.</p>
<p>Another nice thing about this setup is that two identical set ups can be pushed together to make a nice square pairing station hub:</p>
<p><img src="http://www.nomachetejuggling.com/files/level4-stations.png" alt="" title="level4-stations" width="462" height="359" class="aligncenter size-full wp-image-1403" /></p>
<p>Yeah, it&#8217;s extremely expensive to go from Level 0 to here, but it&#8217;s an absolutely amazing setup.  You may quickly find that, with pairing stations set up like this, developers no longer wish to work alone at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nomachetejuggling.com/2011/08/25/mechanics-of-good-pairing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

