<?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>Grantovich.net &#187; coding</title>
	<atom:link href="http://grantovich.net/posts/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://grantovich.net</link>
	<description>Updated with astounding infrequency</description>
	<lastBuildDate>Tue, 29 Jun 2010 01:38:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&#8220;Object&#8221;-Oriented Programming in the Land of ZZT</title>
		<link>http://grantovich.net/posts/2009/08/object-oriented-programming-in-the-land-of-zzt/</link>
		<comments>http://grantovich.net/posts/2009/08/object-oriented-programming-in-the-land-of-zzt/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 23:08:26 +0000</pubDate>
		<dc:creator>Grantovich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[nostalgia]]></category>
		<category><![CDATA[zzt]]></category>
		<category><![CDATA[zzt-oop]]></category>

		<guid isPermaLink="false">http://grantovich.net/?p=378</guid>
		<description><![CDATA[I sometimes say that QuickBASIC was the first programming language I ever learned. This is a half-truth; a shortcut that allows me to avoid a lengthy explanation of what ZZT-OOP is, and how it was really the first programming language I ever learned. But since this is my blog and not a casual conversation, we have a bit [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes say that QuickBASIC was the first programming language I ever learned. This is a half-truth; a shortcut that allows me to avoid a lengthy explanation of what <strong>ZZT-OOP</strong> is, and how <em>it</em> was really the first programming language I ever learned. But since this is my blog and not a casual conversation, we have a bit more room for exposition. Read on, if you&#8217;re curious about languages and game development: ZZT is quite an interesting piece of history.</p>
<p>The year was 1996ish; the family computer, a Windows 3.1 pizza box with a 486 processor and <a href="http://en.wikipedia.org/wiki/CompuServe">CompuServe</a> dial-up internet. In those days I would frequently monopolize it, sinking hours into whatever <a href="http://en.wikipedia.org/wiki/Apogee_Software">Apogee</a> and <a href="http://en.wikipedia.org/wiki/Epic_Games">Epic</a> shareware games I could get my hands on. But since I couldn&#8217;t tie up the phone line with game downloads for too long, my dad would occasionally find something for me with his fast connection at the office, and bring it home on a good old 3.5&#8243; floppy.</p>
<p>On one such occasion, I found myself the recipient of a well-worn disk with the cryptic string &#8220;ZZT 3.2&#8243; scrawled on the label. Into the drive it went, and after a brief configuration prompt&#8230;</p>
<p><img class="alignnone size-full wp-image-390"  src="http://grantovich.net/wp-uploads/p-zzt-town.png" alt="p-zzt-town" width="640" height="400" /></p>
<p>As you can probably tell from the above screenshot, <a href="http://en.wikipedia.org/wiki/ZZT">ZZT</a> is an <a href="http://en.wikipedia.org/wiki/ANSI_art">ANSI-graphics</a> top-down action-adventure-puzzle game. It was created in 1991 by <a href="http://en.wikipedia.org/wiki/Tim_Sweeney_(game_developer)">Tim Sweeney</a>, founder of Epic Games (then called Epic MegaGames), who went on to develop several notable shareware classics of the DOS era and became a key developer of the Unreal engine.</p>
<p>The registered version of ZZT came with four &#8220;worlds&#8221;, each a self-contained game that could be completed in a few hours. While these worlds remain iconic even today, and did much to establish the basic formula for &#8220;classic&#8221; ZZT gameplay, they are not the reason ZZT is so interesting.</p>
<p>Notice the <strong>Board Editor</strong> option in the screen above? If you haven&#8217;t guessed already, ZZT is in fact a complete game creation system. Using a wide variety of items, obstacles, and enemies, you can construct your own game worlds (stored in a &#8220;.zzt&#8221; file) and share them with others. You&#8217;re not limited to the built-in entities, either: ZZT has special generic entities called Objects that can take on any appearance, whose behavior is determined by a program written in <strong><a href="http://en.wikipedia.org/wiki/ZZT-oop">ZZT-OOP</a></strong>, the &#8220;Object&#8221;-Oriented Programming language.</p>
<p><img class="alignnone size-full wp-image-389"  src="http://grantovich.net/wp-uploads/p-zzt-editor.png" alt="p-zzt-editor" width="640" height="400" /></p>
<p>ZZT-OOP is a weird, restrictive little language. Among its oddities:</p>
<ul>
<li>You can&#8217;t create new objects at runtime; all the objects you want to use must already exist before the game starts (with one extremely limited exception)</li>
<li>There are no methods, functions, or anything else that would imply a call stack</li>
<li>The only flow control mechanism is &#8220;messages&#8221;, which are the equivalent of <a href="http://en.wikipedia.org/wiki/Goto">GOTO</a> statements&#8230; except that code in one object can send a message to another object, causing <em>that</em> object to unconditionally jump to a different point in its program</li>
<li>There are no statement blocks; the &#8220;if&#8221; command (which is the only method of conditional flow control) jumps to a specified program location if the condition is true, and falls through to the next statement if it&#8217;s false</li>
<li>The only variable type is boolean, and you can&#8217;t have more than ten of them set to true at the same time</li>
<li>All objects on a &#8220;board&#8221; (game screen) execute their code simultaneously, but objects on other boards cannot be accessed, since a board&#8217;s state is frozen when the player leaves it</li>
</ul>
<p>With this being the first programming language I learned, and QuickBASIC being the second, it&#8217;s a miracle I ever managed to wrap my brain around modern languages at all. But the truth is, ZZT showed me how much <em>fun</em> programming could be, by setting it in the context of a game. Type in some cryptic codes, press a key, and there&#8217;s a little smiley face running around trying to shoot you. Even the tiniest amount of effort yields instant results. This appealed to my ten-year-old attention span, and though I never finished any worlds of my own, ZZT permanently lodged a favorable impression of programming in the back of my brain.</p>
<p>Needless to say, I wasn&#8217;t the only ZZT fan out there. Since the game&#8217;s 1991 release, aspiring game creators have cooked up thousands of ZZT worlds, each one pushing the limits of the engine further than before. Glitches were discovered that, if properly exploited, allowed one to do previously impossible things, like making an object move diagonally or teleporting the player to an arbitrary location. The world file format was reverse-engineered and new editors were created, far surpassing the game&#8217;s built-in editor. Ingenious coders transformed ZZT from a top-down action-adventure game into a sidescroller, an RPG, a stealth game, and many other genres.</p>
<p><img class="alignnone size-full wp-image-429"  src="http://grantovich.net/wp-uploads/p-zzt-mercenary.png" alt="p-zzt-mercenary" width="640" height="400" /></p>
<p>As complex as some of the community&#8217;s later works were, I&#8217;d say the reason ZZT was so successful and long-lived was its simplicity. The simplicity of the text-mode graphics and <a href="http://en.wikipedia.org/wiki/PC_speaker">PC speaker</a> sound effects precluded the possibility of a lengthy media creation process. The extreme simplicity of the scripting language, and the existence of a pre-built engine with a lot of basic functionality included, meant that it was easy to ignore the gritty details of making a game and focus on the actual gameplay. All of these things might seem like severe limitations (they are), but they also dramatically lower the barrier to entry for new world builders.</p>
<p>Relatively few games today are based on user-generated content to the extent that ZZT was, and even fewer have built-in scripting languages. In a 2007 <a href="http://www.digitalmzx.net/forums/index.php?showtopic=12521">interview</a>, Tim Sweeney himself had these words to offer:</p>
<blockquote cite="http://www.digitalmzx.net/forums/index.php?showtopic=12521"><p><strong>Tim Sweeney said:</strong></p>
<p>I&#8217;ve always wanted to build a massive-multiplayer version of ZZT. In other words, a vast interlinked game world built and extended by users using simple ZZT-like tools. Like ZZT, it would be open-ended and community-driven. Players would be able to build their own levels and write scripts for objects, as well as play the game as a character, build up attributes and collect items.</p>
<p>Such a project would tackle all the key technical problems of MMO development without the complexity of a 3D environment. The data required for levels and motion data is also so simple that servers could be run by the community without significant bandwidth expense.</p>
<p>Alas, such a game wouldn&#8217;t be much of a Gears of War killer. <img src='http://grantovich.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  So don&#8217;t expect it to actually happen. But it would be interesting!</p></blockquote>
<p>Indeed it would, Tim. Indeed it would.</p>
<p> </p>
<p><strong>Some links for you:</strong><br />
<a href="http://zzt.belsambar.net/">Z2</a> is the largest archive of worlds and other ZZT-related downloads on the internet, though much of its textual content is outdated. Be sure to check the <a href="http://zzt.belsambar.net/?p=fg">Featured Games</a> list, which includes a lot of famous and influential games in ZZT&#8217;s history. <a href="http://dosbox.com/">DOSBox</a> comes in handy for running ZZT on modern machines (&gt;=10,000 cycles recommended). You might also want to check out ZZT&#8217;s vastly-more-powerful-but-also-more-complex spiritual successor, <a href="http://en.wikipedia.org/wiki/MegaZeux">MegaZeux</a>, which is still developed today.</p>
]]></content:encoded>
			<wfw:commentRss>http://grantovich.net/posts/2009/08/object-oriented-programming-in-the-land-of-zzt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Project Write-up: Twittjr</title>
		<link>http://grantovich.net/posts/2009/05/project-write-up-twittjr/</link>
		<comments>http://grantovich.net/posts/2009/05/project-write-up-twittjr/#comments</comments>
		<pubDate>Wed, 13 May 2009 01:44:27 +0000</pubDate>
		<dc:creator>Grantovich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[project write-ups]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twittjr]]></category>

		<guid isPermaLink="false">http://grantovich.net/?page_id=87</guid>
		<description><![CDATA[Twittjr is a system that allows an IBM PCjr to search the public timeline on Twitter. In case you weren&#8217;t aware, Twitter is a social micro-blogging service introduced in 2006 and has over five million active users. The IBM PCjr is a personal computer introduced in 1984 and has a 4.77MHz processor, 128KB of RAM, and uses 360KB floppy disks [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://grantovich.net/wp-uploads/twittjr-running.jpg"><img class="size-thumbnail wp-image-166  alignright"  src="http://grantovich.net/wp-uploads/twittjr-running-150x112.jpg" alt="Twittjr running in the CSH server room" width="150" height="112" /></a></p>
<p>Twittjr is a system that allows an <a href="http://en.wikipedia.org/wiki/IBM_PCjr">IBM PCjr</a> to search the public timeline on <a href="http://twitter.com">Twitter</a>. In case you weren&#8217;t aware, Twitter is a social micro-blogging service introduced in 2006 and has over five million active users. The IBM PCjr is a personal computer introduced in 1984 and has a 4.77MHz processor, 128KB of RAM, and uses 360KB floppy disks for storage.</p>
<p>It seemed like a good idea at the time.</p>
<p><a href="http://grantovich.net/wp-uploads/twittjr-closeup.jpg"><img class="size-thumbnail wp-image-164 alignright"  src="http://grantovich.net/wp-uploads/twittjr-closeup-150x112.jpg" alt="A close-up of the PCjr monitor while Twittjr is running" width="150" height="112" /></a></p>
<h3>How does that even work?</h3>
<p>Let&#8217;s say you have a PCjr hooked up to an external dial-up modem, which is connected to a phone line. Elsewhere, you have a modern internet-connected computer (call it the &#8220;server&#8221;) with another dial-up modem, connected to another phone line. The PCjr calls the server and establishes a modem connection, which it uses to send a request for whatever search term the user enters. The server uses the <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search">Twitter Search API</a> to download the three most recent posts on the public timeline that match the search, and shoves them back over the phone line to the PCjr, which displays them on the screen in glorious 16-color ASCII-vision. In the absence of user interaction, the PCjr refreshes the search results every minute or so, providing a sort-of-live feed. </p>
<p>Note that while a modern PC is involved, the PCjr is far from being a &#8220;dumb terminal&#8221; in this setup: I intentionally put as much work as I could on the PCjr side, and the server software is tiny in comparison to the pile of BASIC code that runs the client. The only things that aren&#8217;t done on the PCjr are the actual download from the internet (good luck cramming all those protocol stacks into 128KB of RAM!) and the XML parsing (which is possible, but <em>not</em> very fun, in BASIC). The two machines exchange data using a super-simple &#8221;protocol&#8221; I made up on the spot.</p>
<div id="attachment_165" class="wp-caption alignright" style="width: 160px"><a href="http://grantovich.net/wp-uploads/twittjr-dev.jpg"><img class="size-thumbnail wp-image-165"  src="http://grantovich.net/wp-uploads/twittjr-dev-150x112.jpg" alt="The 5.25-inch floppy drive I installed in my desktop to transfer code for Twittjr" width="150" height="112" /></a><p class="wp-caption-text">The 5.25-inch floppy drive I installed in my desktop to transfer code for Twittjr</p></div>
<h3>What&#8217;s the code written in?</h3>
<p>The PCjr software is in Cartridge BASIC, which is essentially <a href="http://en.wikipedia.org/wiki/BASICA">BASICA</a> with some extra bits. Cartridge BASIC is the best of the three forms of BASIC that can be used on the PCjr (the others are Disk BASIC and Cassette BASIC), because the interpreter doesn&#8217;t take up system memory, it runs almost as fast as compiled code, and you can save your programs to disk. It does, however, require that you have A) the actual Cartridge BASIC cartridge, and B) a DOS disk to boot from.</p>
<p>The &#8220;server&#8221; software is a small Ruby script that uses only built-in libraries. It <em>should</em> work on any platform that can run Ruby, but I&#8217;ve only tested it on Linux.</p>
<div id="attachment_160" class="wp-caption alignright" style="width: 122px"><a href="http://grantovich.net/wp-uploads/twittjr-imaginerit.jpg"><img class="size-thumbnail wp-image-160 "  src="http://grantovich.net/wp-uploads/twittjr-imaginerit-112x150.jpg" alt="A picture someone took of Twittjr at ImagineRIT 2009" width="112" height="150" /></a><p class="wp-caption-text">Twittjr at ImagineRIT 2009</p></div>
<h3>How did Twittjr get started?</h3>
<p>As it happens, I&#8217;m a member of <a href="http://www.csh.rit.edu/">Computer Science House</a> at RIT, and one day I discovered a fully-functional PCjr gathering dust on a shelf in one of our common rooms. Noticing that it used BASIC, which I was familiar with from my high school days, I figured I could write some eye-catching application that would attract people to our tables at the <a href="http://www.rit.edu/imagine/">ImagineRIT</a> innovation fair. Lots of CSHers had been joining Twitter recently, including myself, and someone who saw me fiddling with the PCjr suggested putting Twitter on it. Several weeks later, the first version of Twittjr was serving up tweets to curious open-house visitors.</p>
<h3>Can I set this up on my own PCjr? </h3>
<p>Absolutely, as long as you have the following things:</p>
<ul>
<li>One IBM PCjr with DOS boot disk and Cartridge BASIC cartridge</li>
<li>One of the following:
<ul>
<li>Internal PCjr modem installed (limited to 300 baud)</li>
<li>External serial modem with PCjr serial adapter to attach it</li>
</ul>
</li>
<li>A 5.25-inch floppy drive in your own computer, to copy the program</li>
<li>A spare 5.25-inch disk (or use your boot disk if it&#8217;s writable)</li>
<li>Any modern-ish PC to use as a server</li>
<li>A modem for said PC that appears to your OS as a serial device</li>
<li>A working installation of Ruby on said PC</li>
<li>Two phone lines (at least one must be capable of calling the other)</li>
</ul>
<p>And last but not least, you&#8217;ll need the <a href="http://grantovich.net/wp-uploads/twittjr.zip"><strong>Twittjr code package</strong></a>! It includes a README with basic setup instructions, so make sure you look that over before you start.</p>
]]></content:encoded>
			<wfw:commentRss>http://grantovich.net/posts/2009/05/project-write-up-twittjr/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Quoted Argument Parsing in Ruby</title>
		<link>http://grantovich.net/posts/2009/05/quoted-argument-parsing-in-ruby/</link>
		<comments>http://grantovich.net/posts/2009/05/quoted-argument-parsing-in-ruby/#comments</comments>
		<pubDate>Mon, 04 May 2009 23:58:48 +0000</pubDate>
		<dc:creator>Grantovich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[monday]]></category>
		<category><![CDATA[one-liners]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://grantovich.net/?p=148</guid>
		<description><![CDATA[I had a post half-written for today, but decided it wasn&#8217;t going anywhere interesting and scrapped it. I still wanted to post something, so in the spirit of half-finished things, here&#8217;s a nice Ruby one-liner from a half-finished project of mine: gets.chomp.strip.scan(/[^ "]+&#124;"[^"]+"/).map{ &#124;s&#124; s.delete('"') } This takes a line from standard input and splits [...]]]></description>
			<content:encoded><![CDATA[<p>I had a post half-written for today, but decided it wasn&#8217;t going anywhere interesting and scrapped it. I still wanted to post <em>something</em>, so in the spirit of half-finished things, here&#8217;s a nice Ruby one-liner from a half-finished project of mine:</p>
<pre>gets.chomp.strip.scan(/[^ "]+|"[^"]+"/).map{ |s| s.delete('"') }</pre>
<p>This takes a line from standard input and splits it into a space-delimited argument list, with support for quoted arguments that have spaces in them. If you enter <code>'command with "some parameters"'</code>, you&#8217;ll get the array <code>["command", "with", "some parameters"]</code>. Not particularly advanced, but maybe useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://grantovich.net/posts/2009/05/quoted-argument-parsing-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Joys of PCjr Programming</title>
		<link>http://grantovich.net/posts/2009/05/the-joys-of-pcjr-programming/</link>
		<comments>http://grantovich.net/posts/2009/05/the-joys-of-pcjr-programming/#comments</comments>
		<pubDate>Sat, 02 May 2009 00:49:56 +0000</pubDate>
		<dc:creator>Grantovich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[ImagineRIT]]></category>
		<category><![CDATA[PCjr]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[twittjr]]></category>

		<guid isPermaLink="false">http://grantovich.net/?p=131</guid>
		<description><![CDATA[Recently I&#8217;ve been getting my new project, &#8220;Twittjr&#8221; (a mashup of Twitter and an IBM PCjr), ready to attract people to the CSH booth at GCCIS for ImagineRIT. Coding in Cartridge BASIC on a PCjr is simultaneously a fascinating and frustrating experience. On the one hand, it&#8217;s kind of annoying to not have any modern conveniences like, say, functions. But [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-236"  src="http://grantovich.net/wp-uploads/p-pcjr-basic.jpg" alt="p-pcjr-basic" width="496" height="232" /></p>
<p>Recently I&#8217;ve been getting my new project, &#8220;<strong>Twittjr</strong>&#8221; (a mashup of Twitter and an IBM PCjr), ready to attract people to the CSH booth at GCCIS for <a href="http://www.rit.edu/imagine/">ImagineRIT</a>. Coding in Cartridge BASIC on a PCjr is simultaneously a fascinating and frustrating experience. On the one hand, it&#8217;s kind of annoying to not have any modern conveniences like, say, functions. But on the other hand, it&#8217;s sometimes fun to go through the weird brain contortions required to actually <em>do things</em> with Cartridge BASIC.</p>
<p>One of the interesting things about BASIC (at least in this ancient incarnation) is that it&#8217;s much more relaxed than modern languages regarding where you can send its thread of execution. Of course, you only have one thread, so you have to make the most of it. For example:</p>
<pre>10 ON TIMER(30) GOSUB 1000: TIMER ON
20 WHILE 1
30 ' Do something continuously
40 WEND
...
1000 ' Do another thing
1010 RETURN</pre>
<p>Initially this will just go straight into the WHILE loop and do its thing. But every 30 seconds, code execution will hop right out of that loop and jump over to line 1000 for the subroutine. If you&#8217;re doing something really important in the loop and you don&#8217;t want to be interrupted, just TIMER STOP before the important bit and TIMER ON afterward. It&#8217;s an extremely simplistic way of doing things, and doesn&#8217;t take much effort to write, but it also has a number of obvious issues that wouldn&#8217;t come up in a threaded environment (e.g. stalling in the subroutine will make the entire program lock up).</p>
<p>Of course, the vast majority of things you might try to do in BASIC are just plain unreasonably difficult. Subroutines don&#8217;t take parameters, so global variables are the only way to pass data between different parts of your program (not that there&#8217;s any variable type other than global). String manipulation is really fun because literally all you can do is A) Find the position of the first occurrence of a substring within a string, B) Extract a substring from a string based on character offsets, and C) Get the length of a string. Technically you can do everything with those operations that you could do with, say, regular expressions, but try anything more complex than splitting a string into an array and your code starts to look like spaghetti.</p>
<p>At any rate, Twittjr is almost ready for the innovation fair tomorrow; all it needs is some better word wrapping and I can probably call it v1.0. The full project write-up will be posted soon, and I&#8217;ll add the code itself a bit later.</p>
]]></content:encoded>
			<wfw:commentRss>http://grantovich.net/posts/2009/05/the-joys-of-pcjr-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everybody Loves Python</title>
		<link>http://grantovich.net/posts/2009/04/everybody-loves-python/</link>
		<comments>http://grantovich.net/posts/2009/04/everybody-loves-python/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 23:52:53 +0000</pubDate>
		<dc:creator>Grantovich</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[unpopular opinions]]></category>

		<guid isPermaLink="false">http://grantovich.net/?p=114</guid>
		<description><![CDATA[These days, it seems like Python is the darling of high-level programming. People build MMOG servers with it, big companies build web app frameworks with it and start research projects to make it go faster, popular webcomic writers extol its virtues, major Linux distributions include it in their base package set, and its geek-tacular Monty Python references charm the pants [...]]]></description>
			<content:encoded><![CDATA[<p>These days, it seems like Python is the darling of high-level programming. People <a href="http://en.wikipedia.org/wiki/EVE_Online#Development">build MMOG servers with it</a>, big companies <a href="http://arstechnica.com/old/content/2008/04/analysis-google-app-engine-alluring-will-be-hard-to-escape.ars">build web app frameworks with it</a> and <a href="http://arstechnica.com/open-source/news/2009/03/google-launches-project-to-boost-python-performance-by-5x.ars">start research projects to make it go faster</a>, popular webcomic writers <a href="http://xkcd.com/353/">extol its virtues</a>, major Linux distributions <a href="http://www.debian.org/doc/packaging-manuals/python-policy/">include it in their base package set</a>, and its geek-tacular <a href="http://en.wikipedia.org/wiki/Monty_Python">Monty Python</a> references charm the pants off of every former Perl scripter on the interbutts.</p>
<p>If you perceive a slight edge to my voice at this point, it&#8217;s not your imagination. Though I recognize Python&#8217;s wild popularity, I respectfully disagree with certain aspects of its implementation. As such, when I started looking around for a new and hopefully useful language to learn, I chose Ruby instead. Most of my friends have indicated to me, in no uncertain terms, that they think I have made a terrible mistake. After working with Ruby for some time, although I&#8217;m certainly not ready to move away from it, I begin to see where they&#8217;re coming from.</p>
<p>Ruby, for better or worse (actually just worse), is something of a second-class citizen in relation to Python. There are a number of logical and well-established explanations for this: Ruby&#8217;s development lags Python by a few years due to its later introduction date; Ruby&#8217;s documentation is often difficult to locate and navigate; Ruby is just plain slower than Python for many non-trivial tasks (though 1.9 improves on this); compiling native extensions for Ruby on Windows is practically guaranteed <em>not</em> to work; and until very recently, Ruby didn&#8217;t have built-in support for Unicode strings, which is kind of important if you&#8217;re pushing for a global user base. Even in those areas where Ruby is improving, it&#8217;s turning out that Python is too entrenched already for those improvements to make a difference. Python came first, and there ain&#8217;t room in this town for another language that has basically the same features.</p>
<p>At this point you might be asking what&#8217;s so bad about Python that I would instead voluntarily use a language I just described a minute ago as a &#8220;second-class citizen&#8221;. One reason is my personal belief that, conceptually, Ruby is a better (albeit less mature) language than Python. Another reason is the syntax, and I will defend to the death my opinion that Python&#8217;s use of the <a href="http://en.wikipedia.org/wiki/Off-side_rule">Off-Side Rule</a> is unbelievably boneheaded and makes code ten times harder to scan due to the complete lack of block terminators (not to mention the ease with which Python code can be irretrievably mangled if anything so much as sneezes on all your leading spaces). The really annoying thing about this is that the Off-Side Rule is <em>not a required language feature</em> to accomplish any of the cool stuff that Python can do. It&#8217;s just an arbitrary limitation with no solid rationale behind it.</p>
<p>Of course, at the end of the day, no matter how much I personally dislike the way Python does things, it&#8217;s still the more popular language. And given Ruby&#8217;s various failings, I&#8217;m not exactly surprised. For now, I guess I&#8217;ll just keep tinkering around with my little second-class language, and hope it eventually develops some of that secret sauce that makes everybody love Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://grantovich.net/posts/2009/04/everybody-loves-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
