« Eclipse M8: Milestone or inchpebble? | Main | DTSTTCPW »

March 29, 2004

A Polyglot in the making

I've realized that I've been sadly neglecting my range of development languages over the last couple of years. Sure, I've picked up a hint of Python here, a whiff of PL/SQL there, but since I last had to professionally develop in a language apart from Java (2001), I haven't really considered myself even partially fluent in any language I've looked at since university.

With this in mind, and spawned on by a great piece of tell-it-as-it-is stuff from the Pragmatic Programmer boys, I've decided to take the most recent piece of Java code I've been tinkering with and port it to several other languages that I'd like to learn...

The target application is a small utility called DocIndex. It's raison d'etre is fairly simple: from a nominated directory location, trawl through all the subdirectories looking for potential HTML documentation. When such a directory is found, store it's location and generate a simple HTML index page containing all the found directories as the result.

What do I use this for? Basically, I've accumulated a ton of HTML documentation relating to the various applications and (more frequently) languages, libraries and frameworks I've downloaded over the years. And I've been somewhat lax in keeping bookmarks to all this documentation. This tool can be pointed at my hard drive and a couple of minutes later can give me a list of every directory it thinks contains some form of HTML documentation.

The rules it uses for this process are straightforward and somewhat arbitary. A directory is considered to be containing documentation if:

  • The directory name matches one of the supplied suffixes. The default suffiixes are: doc, javadoc, api and manual. I devised this list based on the current contents of my machine.

  • The directory name does not match one of the supplied exclusion prefixes. The default exclusions are: windows, temp, recycler and System Volume Information. No prizes for guessing what platform I do my development on :-)

    Note: the exclusion functionality was added solely for performance.

  • The directory contains a file called index.html

DocIndex uses this set of rules to generate links to all the documentation on my hard drive in a couple of minutes and present them in a usable, albeit not very visually appealing, manner.

The application consists is about 200 Java SLOC (not including tests) and the structure appears in the diagram below:

org_corvine_docindex.gif

Although I have a small list of additional tasks for the current codebase (e.g., threading, further customization, addition of UI, etc.), I'm going to branch the codebase now to begin re-implementing in other languages. So far, I'm targetting the following:

  • Ruby: Everyone else is doing it - why shouldn't I :-)

  • Python: I've only scratched the surface of Python and I'd like to learn more. From what I've seen, I think it might become my scripting language of choice.

  • Squeak Smalltalk: I first looked at Smalltalk at university, but didn't have enough experience to appreciate it. With a few more years under my belt, I'd like to revisit it in light of my current knowledge.

  • Eiffel: As for Smalltalk

  • Perl: As the king of scripting languages, DocIndex is a task well suited to it. Also, I have absolutely no knowledge of Perl so far

I've chosen languages which have a zero dollar cost to use and are sufficiently different to keep me on my toes all of the time. For the same reasons, I've not considered C or C++ implementations.

Wherever possible, I'll try to use the full features of each language, but lack of experience will probably prevent me from an optimal solution in many cases. Still, I'm hoping to gain a fairly good understanding of each language. In addition to this, I'd like to present some findings on the relative suitability of each language for the task at hand.

Posted by Andy Marks at March 29, 2004 02:09 PM

Comments

It always pays to learn new languages and new ways of thinkings.

Besides the obvious technical advantages, it also helps in the romance department... after all, all ladies like cunning linguists. ;)

Posted by: Robert Watkins at April 16, 2004 09:30 AM

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?