A few people asked me recently about my seeming obsession with trying to at least get a cursory grasp of every programming language I come into contact with, and how I go about the process of learning them. It always seemed like a pretty personal, informal process, until I thought about it a little more; I actually have a simple, but fairly formal, approach to learning a new programming langauge to the point where I can do semi-useful things with it (or at least feel comfortable enough to be able to figure out how). So, I decided to document it a little bit and put up a webpage about the effort.
The basic gist of it is "doing homework". (No, really! ;-) For my purposes, that assignment is to recreate a throw-back to the good 'ol days: build a very basic multi-user environment that you can telnet into and interact with other connected users. Nothing fancy, just group and private messaging, see who's connected, and unauthenticated logging in and out. It seems to me that you give a language a pretty good workout by the time you've completed this task; you need to learn basic syntax and the magic to build and/or execute the code (obviously), you usually have to figure out whatever kind of library or extension API scheme is in use (usually networking isn't a core component of a language), learn how to handle objects and threading if applicable and useful, absorb how file I/O is managed (logging, for example), and any number of other things depending on the language and how well it lends itself to this kind of problem.
I'm at the point where I can usually complete the task in a few days, given enough time to work on it and a few trips to the bookstore with my laptop (let's face it, there haven't been any real language design "breakthroughs" in a while, so it's mostly just a matter of wrapping your head around the new syntax). I believe my favorite for this problem so far is Tcl, if only because of how easy it makes serialized, event-driven I/O. Perl, Python, and Ruby seemed roughly equivilent, and C, C++, Java, and C# are a pain in the ass (IMHO, YMMV). (No, not all of those are up on the page yet; I have to re-create them from memory, since it's been a while since I went through the exercise with any of them.) I'm not putting these up to win any style awards; frankly, the code for each example is...well...ugly. But it served the purpose: introduce the language quickly. Hmm, which reminds me, I should see if I still have my Guile implementation lying around somewhere...Scheme/Lisp is actually different enough in structure to be interesting for a project like this.
As a result of my little language project, I decided to get Mono installed to take a whack at trying it in C#. I'm impressed, not by the language (syntactically, I don't see much divergence from Java), but by the maturity of the Mono project iteself. The whole package (which is surprisingly light-weight) installed without a hitch, and it seems to have no difficulty with the code I've thrown at it so far. Nice work, guys. Now, if only "using System.Net.Sockets.EventDriven;" worked...:-) (Astute readers will note that this is a C# issue, not a Mono issue; they may even notice the smiley at the end of the line.)
Doh. Having written the crufty mess that is my resume presenter, you'd think I'd have been more careful about relying on $argv containing parameters passed to the script. Nope. Problem fixed, parameters are now named and read via $_GET. Thank goodness for mailing list archives; I'd have spent a very long time trying to figure out why that wasn't working anymore.
The good 'ol days
Anyone else miss writing things in LPC, or am I the only old throwback around here who remembers such things? Geez, what a fun language and development environment. All this new dynamic jay-two-double-E-ifed whizbang-oriented frobnitz-driven wondersplat-dot-net, makes my head hurt. Bah. I'm going to bed. ;-)