<?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>Trevor Burnham &#187; coding</title>
	<atom:link href="http://trevorburnham.com/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevorburnham.com</link>
	<description>Sure, it works in practice...</description>
	<lastBuildDate>Thu, 24 Jun 2010 12:36:01 +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>Haml 3 (beta) on Rails 3 (beta)</title>
		<link>http://trevorburnham.com/2010/04/22/haml-3-beta-on-rails-3-beta/</link>
		<comments>http://trevorburnham.com/2010/04/22/haml-3-beta-on-rails-3-beta/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 03:12:43 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=475</guid>
		<description><![CDATA[I love Sass, the stylesheet-​​generating cousin of Haml. It’s so much syntactically sweeter than CSS, it lets you define variables and mixins like this handy border-​​radius shortcut, and it works seamlessly in Rails. And Sass 3 is the best version yet, for a number of reasons. Meanwhile, if you’re creating a new Rails project, the Creator Himself has proclaimed that you should be doing it with Rails 3.

But right now, the installation instructions for this lethal combination don’t exactly parse. So here’s what you need to do...]]></description>
			<content:encoded><![CDATA[<p><em>[Note: This post will baffle my usual readers. I intend to bifurcate (trifurcate?) my blog into multiple blogs in the near future: one for development-related stuff, another for startup-related stuff, and another for personal stuff. Until then, I feel that I have a responsibility to help those Googling for solutions to the exact same problems that have been befuddling me in my life as a programmer; this post is entirely for that purpose.]</em></p>
<p>I love <a href="http://sass-lang.com/" class="liexternal">Sass</a>, the stylesheet-generating cousin of <a href="http://haml-lang.com/" class="liexternal">Haml</a>. It’s so much syntactically sweeter than CSS, it lets you define variables and mixins like this <a href="http://github.com/handcrafted/handcrafted-compass-mixins/blob/master/_border-radius.sass" class="liexternal">handy border-radius shortcut</a>, and it works seamlessly in Rails. And Sass 3 is the best version yet, for a <a href="http://nex-3.com/posts/95-awesome-syntax-changes-in-sass-3" class="liexternal">number of reasons</a>. Meanwhile, if you’re creating a new Rails project, the Creator Himself has <a href="http://twitter.com/dhh/status/11446416402" class="liexternal">proclaimed</a> that you should be doing it with Rails 3.</p>
<p>But right now, the installation instructions for this lethal combination don’t exactly parse. So here’s what you need to do:</p>
<ol>
<li>Install the latest Rails (instructions <a href="http://guides.rails.info/3_0_release_notes.html" class="liexternal">here</a>)</li>
<li>Install the latest Haml/Sass distribution: <code>gem install haml --pre</code>. (If you get an error, try updating RubyGems: <code>gem update --system</code>.)</li>
<li>Run <code>haml -v</code> and note the version number. Mine is <code>3.0.0.beta.3</code> (delightfully code-named “Classy Cassidy.”)</li>
<li>Create a Rails project, e.g. with <code>rails ~/MyProject</code></li>
<li>Open up <code>Gemfile</code> in the project root and add the line <code>gem 'haml', '3.0.0.beta.3'</code>, substituting whatever the version number was in step 3.</li>
</ol>
<p>And that’s it! Running <code>haml --rails ~/MyProject</code> appears to be harmless but unnecessary. If I’m wrong about that, someone please let me know.</p>
<p>Related: If you want to get Ruby 1.9 installed on your Mac, I strongly urge you to use <a href="http://github.com/mxcl/homebrew" class="liexternal">Homebrew</a>. If you’re curious about how to set Rubygems so that you don’t have to sudo it, follow the instructions at <a href="http://wiki.github.com/mxcl/homebrew/gems-eggs-and-perl-modules" class="liexternal">this page</a> under the heading “Fixing Rubygems.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/04/22/haml-3-beta-on-rails-3-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing SciPy on Snow Leopard</title>
		<link>http://trevorburnham.com/2010/03/22/installing-scipy-on-snow-leopard/</link>
		<comments>http://trevorburnham.com/2010/03/22/installing-scipy-on-snow-leopard/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 23:46:37 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=398</guid>
		<description><![CDATA[Snow Leopard (Mac OS 10.6) comes with Python and NumPy already installed, which is great—except that the versions it comes with aren’t com­pat­i­ble with SciPy. I’ve spent several hours Googling around, trying to build things from source, etc. with no luck. Lots of people have had this problem. Turns out the solution is actually very simple.]]></description>
			<content:encoded><![CDATA[<p>This is a post that will interest 0% of my usual blog readers, but I’m hoping that it will save some wandering Googlers much frustration.</p>
<p>Snow Leopard (Mac OS 10.6) comes with Python and NumPy already installed, which is great—except that the versions it comes with aren’t compatible with SciPy. I’ve spent several hours Googling around, trying to build things from source, etc. with no luck. Lots of people have had this problem. Turns out the <a href="http://blog.njoubert.com/2010/02/installing-numpy-and-scipy-on-snow-leopard-the-easy-way.html" title="Installing NumPy and SciPy on Snow Leopard - The easy way" class="liexternal">solution</a> is actually very simple. While I can’t claim credit for it, I can elaborate a bit:</p>
<ol>
<li>Run the <a href="http://www.python.org/ftp/python/2.6.4/python-2.6.4_macosx10.3.dmg" class="liexternal">Python 2.6.4 installer</a>. Yes, that really is the version you want. Trust me.</li>
<li>Run the <a href="http://sourceforge.net/projects/numpy/files/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg/download" class="liexternal">NumPy 1.3.0 installer</a>.</li>
<li>Run the <a href="http://sourceforge.net/projects/scipy/files/scipy/0.7.1/scipy-0.7.1-py2.6-python.org.dmg/download" class="liexternal">SciPy 0.7.1 installer.</a></li>
</ol>
<p><strong>One more thing:</strong> The version of Python that came with your system (2.6.1 in <code>/usr/bin</code>) will still be around, and won’t have access to SciPy! What you want to do is run the new version from <code>/usr/local/bin</code>. To verify this, try the command <code>import scipy</code> from each shell.</p>
<p>May you enjoy doing science the Python way as much as I do.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/03/22/installing-scipy-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flicker-free Typekit</title>
		<link>http://trevorburnham.com/2010/01/28/flicker-free-typekit/</link>
		<comments>http://trevorburnham.com/2010/01/28/flicker-free-typekit/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 01:26:22 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Typekit]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=254</guid>
		<description><![CDATA[I’m a fan of Typekit. Being able to go beyond the old Arial-​​Verdana-​​Times-​​Georgia paradigm, on any modern browser, without Flash (unlike sIFR), and with selec­table text (unlike Cufón), is a dream come true. One problem, though: It takes a few mil­lisec­onds to load up and render those fonts. That’s not so bad in itself; what’s bad is that the browser renders every­thing in non-​​Typekit fonts first, creating an annoying flicker every time the page loads as the text gets replaced by fancier fonts.]]></description>
			<content:encoded><![CDATA[<p>[<strong>Update:</strong> On May 14th, 2010, Typekit finally announced an <a href="http://blog.typekit.com/2010/05/14/typekit-font-events/" class="liexternal">official solution</a> to the “flash of unstyled text” problem. So, the fix below should be considered obsolete.]</p>
<p>I’m a fan of <a href="http://typekit.com" class="liexternal">Typekit</a>. Being able to go beyond the old Arial-Verdana-Times-Georgia paradigm, on any modern browser, without Flash (unlike <a href="http://wiki.novemberborn.net/sifr/" title="Scalable Inman Flash Replacement" class="liexternal">sIFR</a>), and with selectable text (unlike <a href="http://cufon.shoqolate.com/" title="Pure JavaScript text replacement" class="liexternal">Cufón</a>), is a dream come true.</p>
<p>One problem, though: It takes a few milliseconds to load up and render those fonts. That’s not so bad in itself; what’s bad is that the browser renders everything in non-Typekit fonts first, creating an annoying flicker every time the page loads as the text gets replaced by fancier fonts.</p>
<p>Fortunately, there’s a fairly easy solution (though not an officially supported one—see below). Just add this to your site body:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;body id=&quot;domain-com&quot;&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://use.typekit.com/KIT_ID.js&quot;&gt;&lt;/script&gt;
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domain-com'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">opacity</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;document.getElementById('domain-com').style.opacity = 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Typekit.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'KIT_ID'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
      afterLoad<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;document.getElementById('domain-com').style.opacity = 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
  &lt;!-- content goes here --&gt; 
&lt;/body&gt;</pre></td></tr></table></div>

<p>Then substitute your actual domain for <code>domain-com</code>, and (<strong>important!</strong>) your site’s unique Typekit ID for <code>KIT_ID</code>. You can get this ID by logging in to Typekit, launching the Kit Editor, and clicking the “Embed Code” link; it’s an 8-letter alphanumeric combination.</p>
<p>Here’s a breakdown:</p>
<ol>
<li>The <code>&lt;body&gt;</code> ID on line 1 isn’t just a good selector; <a href="http://css-tricks.com/id-your-body-for-greater-css-control-and-specificity/" title="CSS-Tricks: ID your body for greater CSS control and specificity" class="liexternal">it’s good form</a>. The most common convention is to use your domain (with a dash instead of a dot), which makes things easier for the <a href="http://userscripts.org/" title="User scripts" class="liexternal">Greasemonkey types</a>.</li>
<li>The script include on line 2 brings in the Typekit description of your site’s kit. You can move this line up to your <code>&lt;head&gt;</code> section if you want.</li>
<li>Line 4 makes your entire site disappear. Because this is at the top of your body, nothing is going to get rendered. It’s important that this line be here, rather than in another file or even at the foot of your body.</li>
<li>The call to <code>Typekit.load</code> does the actual loading of the fonts, and the <code>afterLoad</code> callback will be executed right after that happens. That’s when we want to make the body opaque again, right? Well, not quite. It seems that there’s a small delay between the callback and text refresh. Fortunately, using <code>setTimeout</code> to add a tiny delay (1ms) seems to eliminate this, finally ridding us of the dreaded flicker.
</li>
</ol>
<p><strong>Caveat:</strong> The <code>afterLoad</code> event is currently considered <a href="http://gist.github.com/192350" title="Code released by Typekit but not yet ready for live sites" class="liexternal">experimental</a>. An official solution for avoiding flicker is likely to be added in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/01/28/flicker-free-typekit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Most Important IDE Feature</title>
		<link>http://trevorburnham.com/2010/01/24/the-most-important-ide-feature/</link>
		<comments>http://trevorburnham.com/2010/01/24/the-most-important-ide-feature/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 21:46:44 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=249</guid>
		<description><![CDATA[Why navigate the depths of a file tree when you can simply type the name of the file you want? This is the most impor­tant feature an IDE can offer. In Eclipse, it’s called Open Resource. In TextMate, it’s called Go to File. In Coda and Apple’s own XCode, it’s aptly dubbed Open Quickly.]]></description>
			<content:encoded><![CDATA[<p>Say you’re working on a project with hundreds of files. Changes to one file necessitate changes in others in an unfathomably complex tree structure. Using <code>File -> Open</code> each time you need to switch files is time-consuming, which is why simple text editors have been widely abandoned by programmers in favor of integrated development environments (IDEs) that offer tabs and a widget that shows the file structure at all times. This, more than syntax highlighting, is the reason why few projects are edited in Notepad.</p>
<p>But that’s still not enough. Why navigate the depths of a file tree when you can simply type the name of the file you want? <strong>This is the most important feature an IDE can offer.</strong> In <a href="http://eclipse.org/" class="liexternal">Eclipse</a>, it’s called <code>Open Resource</code>. In <a href="http://macromates.com/" class="liexternal">TextMate</a>, it’s called <code>Go to File</code>. In <a href="http://www.panic.com/coda/" class="liexternal">Coda</a> and Apple’s own <a href="http://developer.apple.com/tools/xcode/" class="liexternal">XCode</a>, it’s aptly dubbed <code>Open Quickly</code>, and goes one step further by performing full-text search on the files in the current project using Spotlight. Personally, I prefer the instantaneous of the Eclipse/TextMate approach; but either way, it’s certainly faster than using the mouse.</p>
<p>If you’re a developer who isn’t using this feature, find it. It will change your life at least as much as I’m guessing <a href="http://quicksilver.en.softonic.com/mac" title="Application launcher for the Mac" class="liexternal">Quicksilver</a> already has.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/01/24/the-most-important-ide-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smalltalk Lives!</title>
		<link>http://trevorburnham.com/2010/01/05/smalltalk-lives/</link>
		<comments>http://trevorburnham.com/2010/01/05/smalltalk-lives/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 18:49:13 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=147</guid>
		<description><![CDATA[I don’t think Smalltalk is going to make a Big Comeback (newer lan­guages like Scala are just too cool), but it’s definitely going to stick around for a while. And unlike the sticky, mal­odor­ous remnants of COBOL, I have no objec­tion to the clean, classic scent of Smalltalk.]]></description>
			<content:encoded><![CDATA[<p><img class="center" src="http://trevorburnham.com/images/Byte_Smalltalk_cover.jpg" width="300" height="405" alt="Byte magazine’s classic Smalltalk cover" />I was under the impression that these days, you’re more likely to find <a href="http://en.wikipedia.org/wiki/Smalltalk" title="Wikipedia: Smalltalk" rel="nofollow" class="liwikipedia">Smalltalk</a> in the History department than the Computer Science department. That is, until:</p>
<ul>
<li>I read a great interview with Dan Ingalls, the “mother of Smalltalk” (Alan Kay is the father) in the excellent <a href="http://www.amazon.com/gp/product/1430219483?ie=UTF8&#038;tag=trevblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430219483" class="liexternal"><em>Coders at Work</em></a>, in which he discusses all the neat, fun things he’s been doing with the language lately, like <a href="http://research.sun.com/projects/lively/" class="liexternal">Lively Kernel</a>, a browser-based programming learning environment, and <a href="http://www.squeak.org/" class="liexternal">Squeak</a>, which powers the One Laptop Per Child laptops, among other things.</li>
<li>I <a href="http://www.infoq.com/interviews/bryant-smalltalk-dabbledb" title="An interview with Avy Brant on DabbleDB, Smalltalk and Persistence" class="liexternal">learned</a> that Smalltalk powers <a href="http://dabbledb.com/" class="liexternal">DabbleDB</a>. DabbleDB is a cool site that hosts spreadsheets in a much more web-like way than services like Google Spreadsheets, which are just trying to ape Excel in the browser (just as Excel aped Lotus 1–2-3, and Lotus 1–2-3 aped VisiCalc…).</li>
<li>All the other geeks interviewed in <em>Coders at Work</em> and <a href="http://www.amazon.com/gp/product/0596515170?ie=UTF8&#038;tag=trevblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596515170" class="liexternal"><em>Masterminds of Programming</em></a> seem to like Smalltalk. C and its descendants (C++, Java…) get a lot of bashing, but Smalltalk is typically treated with unadulterated admiration. If languages were on Rotten Tomatoes, Smalltalk would be <strong>92% fresh</strong><strong>.</strong></li>
</ul>
<p>I don’t think Smalltalk is going to make a <strong>Big Comeback</strong> (newer languages like Scala are just too cool), but it’s definitely going to stick around for a while. And unlike the <a href="http://www.codinghorror.com/blog/archives/001294.html" title="Coding Horror: COBOL is everywhere and nowhere" class="liexternal">sticky, malodorous remnants of COBOL</a>, I have no objection to the clean, classic scent of Smalltalk.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/01/05/smalltalk-lives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Must Die</title>
		<link>http://trevorburnham.com/2010/01/02/php-must-die/</link>
		<comments>http://trevorburnham.com/2010/01/02/php-must-die/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 17:35:28 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=133</guid>
		<description><![CDATA[You could write a fan­tas­tic new blogging platform in Ruby, but would it have Wordpress’s Famous 5-​​Minute Install? No shell access required! Just upload it, go to the instantly avail­able web inter­face, and tell it how to find your database. You know, the one you set up using php­MyAd­min?]]></description>
			<content:encoded><![CDATA[<p><img src="http://trevorburnham.com/images/ruby_gt_php.png" width="610" height="163" alt="PHP &gt; Ruby" />I’ve been working on a mockup for Theoryville, and I wanted to throw together a server-side script to respond to some simple AJAX requests. My first thought was to do it in PHP, but then I remembered that PHP is <strong>the least elegant language in the world</strong>. So, I figured, I’ll do it in Ruby! I wrote what I needed, uploaded it to the Apache server, and I was done—except for the minor detail that Apache wasn’t running the code.</p>
<p>I figured that fixing the problem would be a simple matter of adding an <code>AddHandler</code> line to the Apache configuration. At worst, installing some sort of <a href="http://www.modruby.net/" class="liexternal">mod_ruby</a>. No such luck. Turns out mod_ruby was <a href="http://stackoverflow.com/questions/75001/why-isnt-there-a-viable-modruby-for-apache-yet" title="Stack Overflow: Why isn’t there a viable mod_ruby for Apache yet?" class="liexternal">abandoned</a> many moons ago. The reason? Efficiency. Starting and shutting down an application every time someone makes a query is a stupid, grossly inefficient way of doing things. But guess what? For many applications, folks don’t give a <strong>flying fork</strong> how many processes they spawn. They only care about being able to upload something to their existing web space and have it just work.</p>
<p>Example: You could write a fantastic new blogging platform in Ruby, but would it have Wordpress’s <a href="http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install" class="liwp">Famous 5-Minute Install</a>? No shell access required! Just upload it, go to the <strong>instantly available</strong> web interface, and tell it how to find your database. You know, the one you set up using <a href="http://www.phpmyadmin.net/home_page/index.php" class="liexternal">phpMyAdmin</a>?</p>
<p>Look, the Ruby community is rightly proud of Rails. I’m not saying that large or high-traffic web applications should run on PHP (though Wikipedia and Facebook somehow manage). But if you’re a Rubyvangelist, you need to fight on every front you can—including the <em>just-upload-it-to-Apache</em> front. It’s great that you’ve made installing and running a specialized web server take just 4 shell commands. But for most folks, that’s 4 too many.</p>
<p>Rubyists, I urge you: you need to bring back mod_ruby, for all our sakes. Anything PHP can do, Ruby can do better.</p>
<p><small>[<strong>Addendum:</strong> It’s worth mentioning that there is a solid <a href="http://www.modpython.org/" class="liexternal">mod_python</a>, and it behooves all Apache administrators to install it. Also, I was able to rescue my Ruby script the old-school way: CGI. I added <code>#!/usr/bin/ruby</code> as the first line of the file and changed the extension to <strong>.cgi</strong>. I feel slightly dirty, but it works.]</small></p>
<p><small>[<strong>Update 1/9/10:</strong> While I thought the title was original (at least, to the extent that any hyperbolic title is), it turns out there was an excellent post also called <a href="http://www.steike.com/code/php-must-die/" title="Comparison at steike.com between PHP, Perl and Python as scripting languages" class="liexternal">PHP Must Die</a> back in the dark days of 2004 about how Python and even <strong>*shudder*</strong> Perl are better languages than PHP. I took this fact as a given for this post. Via <a href="http://news.ycombinator.com/" class="liexternal">Hacker News</a>.]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2010/01/02/php-must-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always Be Exploring</title>
		<link>http://trevorburnham.com/2009/12/29/always-be-exploring/</link>
		<comments>http://trevorburnham.com/2009/12/29/always-be-exploring/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:52:41 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=100</guid>
		<description><![CDATA[At some point last summer, I think I hit the 10,000 hours of practice that Malcolm Gladwell posits as a heuris­tic pre­req­ui­site for being really good at some­thing. One thing I learned around hour #7,500 was the impor­tance of testing pieces of code inde­pen­dently as much as possible when building a larger project.]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/File:Syphilis-poster-wpa-cure.jpg" rel="nofollow" class="liimagelink"><img src="http://trevorburnham.com/images/Syphilis_poster.png" class="left" width="222" height="250" alt="Anti-syphilis poster: Get tested!" /></a><a href="http://imprompt.us/2009/code-fast/" title="Peter Boothe: Code fast" class="liexternal">This post</a> by math/CS prof Peter Boothe caught my eye:</p>
<blockquote class="right"><p>What I am claiming here is not just that if you code faster, you will get your solution written faster. I am claiming if you code faster, you will get your solution done MUCH faster. The speedup is greater than linear.</p></blockquote>
<p>I agreed with the sentiment, but I wasn’t sure about his explanation. Then I read this <a href="http://imprompt.us/2009/code-fast/#comment-26963894" class="liexternal">comment</a> from <a href="http://www.p16blog.com/" title="Matt Kangas’s blog: P16" class="liexternal">Matt Kangas</a>:</p>
<blockquote class="right"><p>IMO, the key point is: teach exploratory programming.</p></blockquote>
<p><strong>That’s the answer!</strong> Here’s my experience: I took exactly one CS class as an undergrad; it was so arduous, so time-consuming, that I vowed to myself: <strong>Never again</strong>. But I kept being drawn to various programming projects, so I learned to code competently on my own time. At some point last summer, I think I hit the <a href="http://www.gladwell.com/outliers/outliers_excerpt1.html" title="Malcolm Gladwell: The 10,000 Hour Rule" class="liexternal">10,000 hours</a> of practice that Malcolm Gladwell posits as a heuristic prerequisite for being really good at something. One thing I learned around hour #7,500 was the importance of testing pieces of code independently as much as possible when building a larger project. Beginners always work at the application level: Change something, re-run the application, see if it works. This is sometimes necessary (if, say, you’re changing the UI), but should be avoided whenever possible. Experts tend to write code in small, unit-testable pieces. Many are <a href="http://en.wikipedia.org/wiki/Test-driven_development" title="Wikipedia: Test-driven development" rel="nofollow" class="liwikipedia">test-driven</a>.</p>
<p>Not every test has to be a formal unit test. Just trying out a line or two of code on its own and watching what happens is often useful. This is yet another reason why Java is <a href="http://wikiality.wikia.com/Dead_to_Me" title="Stephen Colbert’s Dead to Me segment" class="liexternal">dead to me</a> as a language. Java is so slanted toward <a href="http://en.wikipedia.org/wiki/Big_Design_Up_Front" title="Wikipedia: Big Design Up Front" rel="nofollow" class="liwikipedia">BDUF</a> that when it sprang forth Athena-like from the head of <a href="http://en.wikipedia.org/wiki/James_Gosling" title="Wikipedia: James Gosling, father of Java" rel="nofollow" class="liwikipedia">James Gosling</a>, it was blessed (?) with a <a href="http://java.sun.com/j2se/javadoc/" class="liexternal">formal standard for documentation</a>, but no command line interpreter—a feature offered by just about every other language, including Java’s spritely yet statically-typed spawn, <a href="http://scala-lang.org/" class="liexternal">Scala</a>.</p>
<p>For those of you building anything big enough for <a href="http://en.wikipedia.org/wiki/Hofstadter&apos;s_law" title="It always takes longer than you expect, even when you take into account Hofstadter’s law" rel="nofollow" class="liwikipedia">Hofstadter’s Law</a> to apply, my #1 piece of advice would be this: <strong>Get your code tested, today!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2009/12/29/always-be-exploring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bridging the Web</title>
		<link>http://trevorburnham.com/2009/12/27/bridging-the-web/</link>
		<comments>http://trevorburnham.com/2009/12/27/bridging-the-web/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 01:58:02 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://trevorburnham.com/?p=74</guid>
		<description><![CDATA[Many exciting new lan­guages have come out in recent years, and the use of multiple spe­cial­ized lan­guages within a single project has become much more common, thanks largely to the polyglot JVM and .NET plat­forms. It’s an exciting time to be a programmer. Unless, of course, you’re pro­gram­ming user inter­faces for the web. Which everyone is.]]></description>
			<content:encoded><![CDATA[<p><a href="http://xkcd.com/353/" class="liimagelink"><img src="http://trevorburnham.com/images/Python_(xkcd).png" class="center" width="518" height="274" alt="Python is a much, much better language than JavaScript" /></a>I’ve been reading a lot about programming languages lately. Many exciting new languages have come out in recent years, and the use of multiple specialized languages within a single project has become much more common, thanks largely to the polyglot <a href="http://en.wikipedia.org/wiki/Java_Virtual_Machine" rel="nofollow" class="liwikipedia">JVM</a> and <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="nofollow" class="liwikipedia">.NET</a> platforms. It’s an exciting time to be a programmer.</p>
<p>Unless, of course, you’re programming user interfaces for the web. Which everyone is.</p>
<p>As <a href="http://codinghorror.com/blog/" class="liexternal">Jeff Atwood</a> has said, “Everything that can be programmed in JavaScript will be.” That’s because the browser is the most popular operating system on the planet, and JavaScript is its <a href="http://www.codinghorror.com/blog/archives/000857.html" title="Jeff Atwood on JavaScript as the lingua franca of the web" class="liexternal"><em>lingua franca</em></a>. But no one likes JavaScript. Or, more precisely, no one falls in love with JavaScript the way that people fall in love with <a href="http://www.ruby-lang.org/en/" class="liexternal">Ruby</a> or <a href="http://www.python.org/" class="liexternal">Python</a> or (my favorite of late) <a href="http://scala-lang.org/" class="liexternal">Scala</a>.</p>
<p>I never fully understood why JavaScript was so kludgy and inelegant until I read the (highly recommended) interview collection <a href="http://www.amazon.com/gp/product/1430219483?ie=UTF8&#038;tag=trevblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430219483" title="Buy Coders at Work on Amazon" class="liexternal"><em>Coders at Work</em></a>. Long story short, one guy at Netscape (<a href="http://en.wikipedia.org/wiki/Brendan_Eich" rel="nofollow" class="liwikipedia">Brendan Eich</a>) threw the language together in ten days, with the stated goals of creating something semantically <a href="http://en.wikipedia.org/wiki/Scheme_%28programming_language%29" rel="nofollow" class="liwikipedia">Scheme</a>–like but syntactically Java-like. <strong>Good god!</strong></p>
<p>So why are we still, 14-odd years later, still using the same language for all of our webapps? Because even if some backwards-incompatible NewScript were introduced, standardized and embraced by Microsoft, Mozilla, Google and Apple <em>tomorrow,</em> most people would take years to update to a browser sufficiently newfangled to run it. Heck, most people <a href="http://www.slate.com/id/2229511/" class="liexternal">don’t even know what a browser <em>is</em></a>. Thus, new webapps have to be written in a half-baked language to be run through decade-old interpreters.</p>
<p>But there is a solution. And for all I know, Sergey Brin and Larry Page are already plotting its execution from their orbital battlestation. (Where did you think those Google Earth pics come from?) What we need is a new language for web browsers (or, better yet, a virtual machine standard that could support multiple languages), along with a compiler that can generate JavaScript for the benefit of old-timers. The project would be insanely difficult, but it’s half-done already. Look at <a href="http://code.google.com/webtoolkit/" class="liexternal">GWT</a>, which lets you write Java that compiles to JavaScript. Now suppose that a browser (say, Chrome 5) could run GWT’s Java bytecode directly, bypassing JavaScript altogether. Chrome 5 users would enjoy a much smoother and potentially richer web experience. Meanwhile, older browsers would still present a perfectly usable webapp. And programmers everywhere would rejoice.</p>
<p>That, I hope, is the future of the web. So please, Google, I urge you: Don’t let my children grow up in a world that runs on JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorburnham.com/2009/12/27/bridging-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
