<?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>BLARGH!! for the people &#187; coders at work</title>
	<atom:link href="http://blargh.tommymontgomery.com/category/coders-at-work/feed/" rel="self" type="application/rss+xml" />
	<link>http://blargh.tommymontgomery.com</link>
	<description>It&#039;s time to bring forth the rhythm and the rhyme</description>
	<lastBuildDate>Fri, 09 Jul 2010 04:03:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>When Test Driven Design Fails</title>
		<link>http://blargh.tommymontgomery.com/2009/12/when-test-driven-design-fails/</link>
		<comments>http://blargh.tommymontgomery.com/2009/12/when-test-driven-design-fails/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 03:29:53 +0000</pubDate>
		<dc:creator>tmont</dc:creator>
				<category><![CDATA[coders at work]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blargh.tommymontgomery.com/?p=274</guid>
		<description><![CDATA[In the last couple years, there has been a lot of buzz around things like &#8220;Agile&#8220;, &#8220;Scrum&#8220;, &#8220;TDD&#8220;, and other stupid stuff that wraps an acronym around common sense. Basically, they&#8217;re all a way for people to make money by writing books telling people how to develop software. The target market is non-technical managers, developers [...]]]></description>
			<content:encoded><![CDATA[<p>In the last couple years, there has been a lot of buzz around things like &#8220;<a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a>&#8220;, &#8220;<a href="http://en.wikipedia.org/wiki/Scrum_%28development%29">Scrum</a>&#8220;, &#8220;<a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>&#8220;, and other stupid stuff that wraps an acronym around common sense. Basically, they&#8217;re all a way for people to make money by writing books telling people how to develop software. The target market is non-technical managers, developers who aren&#8217;t very good at their job, and executives who enjoy acronyms.</p>
<p>It&#8217;s not all bad, though. Agile and scrum are basically a fancy way of saying &#8220;communicate more&#8221;, and if you can get &#8220;the business&#8221; to talk to you more and all it takes is an overloaded word like &#8220;scrum&#8221;, go for it. Mostly, though, I hear &#8220;scrum&#8221; and &#8220;agile&#8221; and &#8220;tdd&#8221; as cop-out explanations used by developers to explain why they aren&#8217;t very good at their jobs.</p>
<ul>
<li><em>The project is late because the requirements were constantly changing.</em></li>
<li><em>We didn&#8217;t catch the bug because we didn&#8217;t have enough time for testing</em></li>
<li><em>100% code coverage is impossible</em></li>
</ul>
<p>All of these issues can be solved by being better at your job. Learn how to communicate with your customers. Learn how to budget your time. Learn how to write tests. Scrum and agile and tdd <strong>mitigate</strong> these issues, they don&#8217;t solve them. They <strong>force</strong> you to communicate, and write tests, but if you&#8217;re not <strong>good</strong> at communicating or writing tests, doing more of it isn&#8217;t going to help you.</p>
<p>Of course, if your manager is an idiot, then you&#8217;re screwed, and you will always have these problems.</p>
<p>But this article is less about whining in general and more about whining about TDD. Let&#8217;s commence.</p>
<h2>Case Study: Sudoku Solver</h2>
<p>Peter Norvig works at Google as Director of Research (I&#8217;m sure that actually means something) and before that he worked at NASA as some kind of AI genius/hacker. He&#8217;s a smart guy who&#8217;s been programming for a long time.</p>
<p>In <a href="http://blargh.tommymontgomery.com/category/coders-at-work/">Coders at Work</a>, Norvig talks about a TDD experience of his involving an algorithm for solving Sudokus. It was interesting to me because I wrote a Java applet (shudder) to do that for a college assignment. It was an interesting problem involving recursion, threading, backtracking, memoization and other stuff that academics love.</p>
<p>What happened is that he wrote an algorithm to solve them, and then someone else, from the TDD community, saw it and attempted to write the same algorithm using test driven development: that is, by writing the tests first, and allowing the tests to influence the design of the algorithm.</p>
<blockquote><p>It&#8217;s also important to know what you&#8217;re doing. When I wrote my Sudoku solver, some bloggers commented on that. They said, &#8220;Look at the contrast&mdash;here&#8217;s Norvig&#8217;s Sudoku thing and then there&#8217;s this other guy, whose name I&#8217;ve forgotten, one of these test-driven design gurus. He starts off and he says, &#8220;Well, I&#8217;m going to do Sudoku and I&#8217;m going to have this class and first thing I&#8217;m going to do is write a bunch of tests.&#8221; But then he never got anywhere. He had five different blog posts and in each one he wrote a little bit more and wrote lots of tests but he never got anything working because he didn&#8217;t know how to solve the problem.</p>
</blockquote>
<p>The problem that the TDD guy encountered was twofold:</p>
<ol>
<li>He didn&#8217;t know anything about Sudoku</li>
<li>He tried to solve that by writing tests</li>
</ol>
<p><strong>Tests are not a replacement for knowledge.</strong> That seems like a stupid statement, but it&#8217;s something that a lot of TDD/Agile advocates sometimes forget. They might complain that we&#8217;re not practicing scrum correctly, but practicing scrum correctly doesn&#8217;t guarantee that anything will get better. Instead of blindly following a wikipedia article to determine how to run your project or write code, you should figure out what&#8217;s wrong, and then solve that in the way that makes the most sense. You might even discover that you&#8217;ll start practicing scrum correctly as a byproduct of common sense. Common sense is why most development methodologies exist. Stuffing your current situation into the fad-of-the-moment is not going to solve your problems, although it might by accident. But I wouldn&#8217;t hold your breath.</p>
<p>Anyway, back to Sudoku. The TDD guy tried to solve the Sudoku problem by writing tests for a problem he did not understand, which meant whatever tests he was writing were <strong>totally worthless</strong>, which is something <strong>he actually admits</strong> in the very first article. After five articles and a great deal of code and a great deal of tests, a Sudoku solver did not exist.</p>
<p>From the <a href="http://xprogramming.com/xpmag/OKSudoku">first article</a>:</p>
<blockquote><p>Arguably this is a violation of YAGNI, but since I don’t really know how to start or how to know when I’m done, writing some Spike code in TDD style seems to me to be a good way to get my feet wet.</p>
</blockquote>
<p>WRONG. A good way to get your feet wet is to do some research about the problem (the internet is your friend) to see if you&#8217;re going in the totally wrong direction.</p>
<blockquote><p>My plan, subject as always to change, is to code something up in that way that I have, to see what happens</p>
</blockquote>
<p>FAIL. &#8220;To see what happens?&#8221; I&#8217;m glad I don&#8217;t work with this guy. If you&#8217;re randomly writing code to determine if your plan is either absolutely perfect or absolutely idiotic, you&#8217;re doing it wrong.</p>
<p>Norvig solved the Sudoku problem by understanding the problem, understanding the solution, and then writing the code. He probably wrote some tests at some point, but they most definitely did not influence his design. What influenced his design was personal experience and a vast knowledge of search algorithms.</p>
<p>Of course, you aren&#8217;t going to have vast knowledge of every problem you&#8217;re trying to solve, but that&#8217;s not the point. The point is that writing tests first is not always the correct decision. If you don&#8217;t know anything about the problem or how to solve it, writing a test is not going to help you. All it will do is make you write a lot of code that is probably worthless.</p>
<p>Read for yourself:</p>
<ul>
<li><a href="http://norvig.com/sudoku.html">Norvig&#8217;s original Sudoku solver</a></li>
<li>The TDD approach: <a href="http://xprogramming.com/xpmag/OKSudoku">1</a>, <a href="http://xprogramming.com/xpmag/Sudoku2">2</a>, <a href="http://xprogramming.com/xpmag/SudokuMusings">3</a>, <a href="http://xprogramming.com/xpmag/Sudoku4">4</a>, <a href="http://xprogramming.com/xpmag/sudoku5">5</a></li>
<li><a href="http://pindancing.blogspot.com/2009/09/sudoku-in-coders-at-work.html">The article Norvig references</a></li>
<li><a href="http://www.infoq.com/news/2007/05/tdd-sudoku">Another summary</a></li>
</ul>
<h2>Case Study: Wiki Engine</h2>
<p>Recently, I decided to write a <a href="http://websvn.tommymontgomery.com/filedetails.php?repname=butterfly&#038;path=%2Ftrunk%2Fbutterfly.php">wiki engine</a>. Why? Because I wanted to. I&#8217;m aware of the hundreds of other wiki engines, but it&#8217;s an interesting problem, and reinventing the wheel is a lot of fun, just make sure you&#8217;re doing it on your own time.</p>
<p>Anyway, I started and stopped several times, deleting large chunks and rewriting them as I went. That is probably not the best way to develop, but whatever. At one point, I wrote a test that looked similar to this:</p>
<pre class="brush: php;">
public function testHeaderGetsParsedCorrectly() {
  $wikitext = &lt;&lt;&lt;WIKI
!Header level 1
!!Header level 2
WIKI;

  $expected = &lt;&lt;&lt;HTML
&lt;h1&gt;Header level 1&lt;/h1&gt;
&lt;h2&gt;Header level 2&lt;/h2&gt;

HTML;

  $this-&gt;assertEquals($expected, $this-&gt;wikiEngine-&gt;toHtml($wikitext));
}
</pre>
<p>Nothing wrong with that. It&#8217;s testing that the given wiki text gets transformed into the correct HTML. Pretty straightforward.</p>
<p>However, this gives me absolutely no insight to the design of the overall engine. I could easily write a function that will do this, but will it be the correct design? Let&#8217;s probe deeper.</p>
<p>I&#8217;ve written wiki engines before (they sucked). I&#8217;ve looked at other wiki engines, and done a bit of research into <a href="http://en.wikipedia.org/wiki/Lexical_analysis">Lexical Analysis</a> and <a href="http://en.wikipedia.org/wiki/LALR_parser">certain kinds of parsers</a>. I know a little bit about how to write something that parses something else. I didn&#8217;t really use any of that knowledge in my own personal wiki engine, because using <a href="http://en.wikipedia.org/wiki/Yacc">yet another parser generator</a> in a wiki engine written in PHP would be an impressive waste of my time, even from a purely academic point of view. But I digress. I was talking about why TDD was a bad idea in this situation.</p>
<p>All this test can tell me is that I need a function that should transform some text into some other text. How do I handle scoping? How do I handle block elements vs. inline elements? How do I handle escaping? Can the solutions to these problems be reused, or is it a one-off kind of thing that can be hard-coded in one place?</p>
<p>I ran into all of these problems after I had already written several tests. Everything worked, but the design was crap. There was no way I could handle a nested element (like say, a string of bold text inside a list item). I had to completely rethink my design. The amusing part is that <strong>the tests did not change</strong>, only my design. TDD utterly failed in influencing my design.</p>
<p>It could be argued that my tests were not good enough. I would argue that my tests are fine. The actual implementation of the engine is not something I care about. I don&#8217;t care if use a scope stack or if I keep track of nested elements in a different way, which is why my tests are only interested in results, not design. I could write some tests that look like the following:</p>
<pre class="brush: php;">
public function testBoldIsAddedToScopeStack() {
  $wikitext = '__bold text__';
  $this-&gt;wikiEngine-&gt;toHtml($wikitext);
  $this-&gt;assertContains(array('type' =&gt; 'strong'), $this-&gt;wikiEngine-&gt;scopeStack);
}
</pre>
<p>Oh wait, that&#8217;s an absolutely terrible design, for several reasons. First of all, the scope stack should not be publicly available. I suppose I could add a public <kbd>scopePeek()</kbd> method that just returns the last pushed scope, but why? To satisfy a unit test? Testing should influence design, but you shouldn&#8217;t sacrifice design for testing. Don&#8217;t make methods public because you can&#8217;t test them otherwise.</p>
<p>Secondly, <kbd>toHtml()</kbd> is not incremental. When I pass text into it, I want HTML returned. I can&#8217;t just parse half of it and then check that it was parsed correctly; that makes no sense for a wiki engine. There isn&#8217;t ever a time when you would want to parse something halfway. Again, I&#8217;d have to sacrifice design to satisfy my unit test. That&#8217;s not going to happen.</p>
<p>Another solution is to just not close the scope, something like this:</p>
<pre class="brush: php;">
$wikitext = '__bold text'; //no closing &quot;__&quot;
</pre>
<p>However, I want the engine to automatically close scopes when it reaches EOF. So the <kbd>toHtml()</kbd> method does that at the end automatically, which means that after I call <kbd>toHtml()</kbd> the scope stack will <em>always</em> be empty. I could move that functionality into another public function, but why would I want to expose that functionality publicly? There&#8217;s no reason. I <strong>always</strong> want to close scopes; I don&#8217;t want that decision left up to the implementer of the wiki engine.</p>
<p>In the end, there was no way for me to test that a scope got pushed onto the stack correctly. In fact, I realized that I really didn&#8217;t want to test that anyway. What if I wanted to change the scope stack to a queue? Then I&#8217;d have dozens of breaking tests because now the internal data structure is FIFO instead of LIFO. Is that something that should be tested? In my opinion, absolutely not. A long as the parsing works correctly, I don&#8217;t particularly care about the internal data structure of the engine. If performance is a concern, I can write tests to verify that parsing some hideously long whiny anti-TDD article takes x amount of seconds at the most. Then if a change to the internal data structure causes that test to break, then I know I&#8217;ve got something to fix. In that way TDD could influence my design, but up front, there&#8217;s no test that could have told me what my design should look like. I had to analyze problems that were hidden to the public interface and solve them without tests.</p>
<p>This seems a rather contrived example, but it&#8217;s an example that I encountered while trying to employ TDD to help me write some code (IRL, as it were). The fact is, this methodology <strong>just didn&#8217;t work</strong> for this problem. It was creating hindrances and forcing me to sacrifice a solid, safe design for the sake of testing something that didn&#8217;t really need to be tested. And it didn&#8217;t even give me the help I needed, which was how to construct the internal engine so that nested elements were rendered correctly. The fact is that I needed more experience in parsing engines before I could confidently design a parser that correctly handled nested scopes. This was something that required some trial and error before a design that solved the problem emerged. TDD wasn&#8217;t going to give me that no matter what kind of tests I wrote.</p>
<h2>Conclusion</h2>
<p>I&#8217;m not here to bash testing. I&#8217;m all for testing, in ways that might <a href="http://tommymontgomery.com/projects#Testify">surprise you</a>. I&#8217;m all for testing in ways that make people develop better. Some people just aren&#8217;t suited for TDD, and not every problem requires a unit test. In most cases, common sense will solve more problems than writing a test ever would.</p>
<p>And if anyone actually looks at my wiki engine, I had specific goals in mind, which is why it&#8217;s shoved in one giant class and uses arrays for stuff instead of objects. I don&#8217;t want to hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blargh.tommymontgomery.com/2009/12/when-test-driven-design-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coders at Work: Brad Fitzpatrick</title>
		<link>http://blargh.tommymontgomery.com/2009/11/coders-at-work-brad-fitzpatrick/</link>
		<comments>http://blargh.tommymontgomery.com/2009/11/coders-at-work-brad-fitzpatrick/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 06:22:56 +0000</pubDate>
		<dc:creator>tmont</dc:creator>
				<category><![CDATA[coders at work]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://blargh.tommymontgomery.com/?p=223</guid>
		<description><![CDATA[When I read the introduction to the chapter on Brad Fitzpatrick, I was slightly worried. He&#8217;s the guy who invented LiveJournal, which has been ridiculed (for good reason) ever since I&#8217;ve been using the internet. I knew some people in college who had LiveJournal accounts, and they were the kind of people who were always [...]]]></description>
			<content:encoded><![CDATA[<p>When I read the introduction to the chapter on <a href="http://bradfitz.com/">Brad Fitzpatrick</a>, I was slightly worried. He&#8217;s the guy who invented <a href="http://www.livejournal.com/">LiveJournal</a>, which has been ridiculed (for good reason) ever since I&#8217;ve been using the internet. I knew some people in college who had LiveJournal accounts, and they were the kind of people who were always whining about something trivial in their life (&#8220;my girlfriend broke up with me/died/admitted her bulimia problem/is too fat/is too skinny/cut herself/beat me up/hates me/hates her mom/doesn&#8217;t have a mom/etc.&#8221;). It wasn&#8217;t pleasant. It was like the MySpace for people who had no friends.</p>
<p>Anyway, it turns out Brad Fitzpatrick (let&#8217;s call him fitzy) is kind of a programming prodigy. He got his start reading computer manuals when he was five, and started programming in BASIC when he was six. He recounted one anecdote wherein instead of doing his long division homework in elementary school, he wrote a computer program that worked it all out for him, including the intermediary steps, which he printed out, and then copied it in pencil to his homework sheet. That&#8217;s a high level of nerdity at a very young age. That&#8217;s like, a Jason Fox-level nerdity usually reserved for fictional situations involving an iguana and some kind of sibling blackmail.</p>
<p>fitzy is young, born in 1980, which means he doesn&#8217;t know Lisp. Which means he&#8217;s awesome. His primary hackery is done in Perl and C, but now that he works for Google, it&#8217;s Python, Java and C++, which Google apparently regards as the holy trinity of programming languages. He&#8217;s also the author of <a href="http://www.danga.com/memcached/">memcached</a>, which is a huge surprise to me. If you had asked me who wrote memcached and who wrote LiveJournal, I would have said &#8220;a genius and an idiot&#8221;. Rarely do those two coincide.</p>
<p>Peter Seibel is revealing himself as less of the stereotypical brown-nosing, sycophant-ish interviewer as he calls fitzy out on some contradictions. fitzy is whining about the inflexibility of Java programmers (don&#8217;t even get me started about them) and their refusal to use the <a href="http://en.wikipedia.org/wiki/Java_Native_Interface">JNI</a> for interoperability, and then later talks about how Google&#8217;s inflexibility with multi-language support is actually good.</p>
<blockquote><p>The problem with that is that you end up writing everything twice, once for C++ and Python and all the other languages, and then once for Java. So if they could come up with a good embedding story or get over this fear of JNI, then I wouldn&#8217;t mind it.</p>
</blockquote>
<p>Later, when fitzy is singing the praises of the <a href="http://code.google.com/appengine/">Google App Engine</a>, Seibel calls him out.</p>
<blockquote><p><strong>[fitzy]</strong>: The fact that App Engine gives you one button, &#8220;Put this on the Web,&#8221; and you write in one language, arguably a pretty easy-to-learn one, Python, is perfect. It&#8217;s a great into to programming &#8211; there are so many layers and layers of bullshit that it gets rid of.</p>
<p><strong>[Seibel]</strong>: How does that fit with your dismay at the Java guys who tell you &#8220;Oh, Java takes care of that for you.&#8221; Isn&#8217;t that the same? &#8220;Well, App Engine will take care of that for you.&#8221;</p>
<p><strong>[fitzy]</strong>: I don&#8217;t know. Maybe it&#8217;s because I know what&#8217;s going on.
</p>
</blockquote>
<p>Radness.</p>
<p>There&#8217;s also some good insight into the software development lifecycle at Google, including coding guidelines, standards, release schedules and ownership. Apparently it&#8217;s pretty wide open: the entire codebase is totally open to everyone, and anyone can submit patches or commit as long as they get it code reviewed and get the approval of the directory owner. That openness is probably why Google has been so successful.</p>
<p>I&#8217;m sincerely hoping one of the interviews in this book will reveal someone who&#8217;s not a bigot toward other languages other than the ones they are experts in. fitzy did not deliver on that.</p>
<p>One interesting thing about fitzy is that he uses the same question in every interview: implement arbitrary precision multiplication. Apparently that was a question on his <a href="http://en.wikipedia.org/wiki/Advanced_Placement">AP</a> CS test in high school. Let&#8217;s see what I can do:</p>
<pre class="brush: php;">
function multiply($string1, $string2) {
	$len1 = strlen($string1);
	$len2 = strlen($string2);

	$result = array_fill(0, $len1 + $len2, 0);
	for ($i = $len1 - 1; $i &gt;= 0; $i--) {
		$val1 = intval($string1[$i]);

		for ($j = $len2 - 1; $j &gt;= 0; $j--) {
			$val2 = intval($string2[$j]);
			$value = $val1 * $val2;
			$index = ($len1 + $len2 - 1) - ($len1 - $i - 1) - ($len2 - $j - 1);
			addWithCarry($result, $index, $value);
		}
	}

	return ltrim(implode('', $result), '0');
}

function addWithCarry(array &amp;$result, $index, $value) {
	if ($result[$index] + $value &gt;= 10) {
		$temp = $result[$index] + $value;
		$result[$index] = $temp % 10;
		addWithCarry($result, $index - 1, floor($temp / 10));
	} else {
		$result[$index] += $value;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blargh.tommymontgomery.com/2009/11/coders-at-work-brad-fitzpatrick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coders at Work: Jamie Zawinski</title>
		<link>http://blargh.tommymontgomery.com/2009/10/coders-at-work-jamie-zawinski/</link>
		<comments>http://blargh.tommymontgomery.com/2009/10/coders-at-work-jamie-zawinski/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 23:40:36 +0000</pubDate>
		<dc:creator>tmont</dc:creator>
				<category><![CDATA[coders at work]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://blargh.tommymontgomery.com/?p=208</guid>
		<description><![CDATA[I&#8217;m reading through Coders at Work, which is basically a bunch of interviews with famous programmers. I just read the first chapter, which is an interview with Jamie Zawinski, who was part of the first team of developers at Netscape (he worked on the Unix part) and also is/was a developer/evangelist of the chlamydia of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m reading through <a href="http://www.codersatwork.com/">Coders at Work</a>, which is basically a bunch of interviews with famous programmers. I just read the first chapter, which is an interview with <a href="http://www.jwz.org/">Jamie Zawinski</a>, who was part of the first team of developers at Netscape (he worked on the Unix part) and also is/was a developer/evangelist of the chlamydia of editors known as <a href="http://en.wikipedia.org/wiki/Emacs">Emacs</a>.</p>
<p>It was an interesting interview. <a href="http://www.joelonsoftware.com/">Joel Spolsky</a> referred to him as the penultimate <a href="http://www.joelonsoftware.com/items/2009/09/23.html">Duct Tape Programmer</a>, whatever that means. I assume he meant to type &#8220;hacker&#8221; but misspelled it. It&#8217;s a common typo; <a href="http://www.bash.org/?5300">the keys are like right next to each other</a>.</p>
<p>Anyway, it&#8217;s clear from the beginning that jwz (as all of his friends call him) is a Lisp geek. So I pretty much hated him right away. Nothing annoys me more than people who think every language except the one they know really well is total crap. ALL languages suck. Except C#, which is God&#8217;s gift to man. But that doesn&#8217;t count because everybody already knows that.</p>
<p>The first couple pages are dedicated to the glorification of Lisp, and Lucid Lisp, and Common Lisp, and other things that only people over 50 know about, and the damnation to eternal Hell of Perl and C++ templates. I took a Common Lisp class in college and I came away with two things:</p>
<ol>
<li>Recursion is awesome</li>
<li>I never want to touch Lisp again</li>
</ol>
<p>There were other corollary (<em>koar-uh-larry</em>, dammit; I was a math major) things I learned, such as &#8220;Lisp sucks&#8221; and &#8220;Why are there so many parentheses&#8221; and &#8220;Why can&#8217;t any Lisp programmer format their code in a readable fashion.&#8221; All in all, it was a decidedly academic experience, which is where Lisp should have stayed: in academia. But I digress.</p>
<p>j-dub talked about his early days of hacking telephones, hating school, and generally being an all around Lisp pimp (Pisp?) by the time he was 15. His monologue on his days at Netscape were more interesting (unless you&#8217;re that other guy who knows Lisp) than his descriptions of his oddly creepy love affair with Emacs, or his equally creepy hatred of <a href="http://www.gnu.org/software/gdb/">GDB</a>. If I knew how to debug C code by looking at opcodes, memory addresses and registers, then that would have been a good read, but since I was born after the death of Hitler (Godwin&#8217;s law) I didn&#8217;t really understand any of it.</p>
<p>The more interesting parts were how he rewrote Richard Stallman&#8217;s C compiler, and him making fun of how everybody else&#8217;s code sucks. Because nothing is as much fun to a programmer as mocking and degrading the hard work of another programmer. That&#8217;s not a joke. I currently pay my rent by doing that.</p>
<p>The one thing which I truly enjoyed from the chapter was his description of the Gang of Four&#8217;s <a href="http://en.wikipedia.org/wiki/Design_Patterns_%28book%29">Design Patterns</a>. And I quote:</p>
<blockquote><p>Then there was another book that everybody thought was the greatest thing ever in that same period &#8211; Design Patterns &#8211; which I just thought was crap. It was just like, programming via cut and paste. Rather than thinking through your task you looked through the recipe book and found something that maybe, kind, sorta felt like it, and then just aped it.</p>
<p><em>&#8230;snip&#8230;</em></p>
<p>Then in meetings they&#8217;d be tossing around all this terminology they got out of that book. Like, the inverse, reverse, double-back-flip pattern &#8211; whatever. Oh, you mean a loop? OK.
</p>
</blockquote>
<p>That reminds of a story of how one of my coworkers was showing me a .NET <a href="http://en.wikipedia.org/wiki/Inversion_of_control">IoC</a> container called <a href="http://www.codeplex.com/unity">Unity</a>. It&#8217;s nice, and gives you exactly what you&#8217;d want out of an IoC container for the most part. Like every other framework ever, it&#8217;s inherently confusing with plenty of misleading indirection. But it&#8217;s another thing to put on your resume.</p>
<p>Anyway, he was explaining how he was using the <a href="http://www.martinfowler.com/eaaCatalog/unitOfWork.html">Unit of Work</a> principle here, and&#8230; &#8220;Wait, what&#8217;s unit of work?&#8221; I asked. He replied, &#8220;Well, it&#8217;s basically a transaction, that, uh&#8230; enables you to safely&#8230; execute&#8230; some piece of code&#8230; and&#8230; uh&#8230;&#8221; I cut him off after 10 seconds of niners and said, &#8220;You had me at &#8216;transaction&#8217;&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blargh.tommymontgomery.com/2009/10/coders-at-work-jamie-zawinski/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
