Monthly Archives: February 2009

Open Source Software Engineering

The Web Browser as a NeoVictorian Computing Triumph

I had a minor realization today about what Mark Bernstein was talking about in his blog posts about NeoVictorian Computing (which I mentioned earlier).  I had emotionally connected to what he was saying about how the software industry should return to an ethos of craft and artisanship, and how software should not try to hide its joints or its materials, but rather be constructed honestly and display its structure.  I got it, kind of, but the ideas remained abstract for me.

But I realized today that in fact the web browser, now so ubiquitous, is in its own way very much of a kind with his ideas.  Sure, browsers now are built by large teams, but the original Mosaic browser was designed and implemented by a few talented people at NCSA. And though browsers have gained a lot of functionality and efficiency through years of revision, they still retain the essential form of the original.  The exposed URLs in the location bar giving evidence of the network protocols and spaces between the loaded documents. That simplicity and willingness to make the user meet the technology head on is part of what has made the browser such a success as a technology.

Ruby Software Engineering

First Impressions of Ruby

I’ve been reading my way through The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto over the last couple of weeks (very well-written, by the way) and having read up through Chapter 7, I’m about at the point now where I’m ready to do something useful with the language.  I figure now is a good time to jot down a few quick first impressions of Ruby before I get comfortable enough with the language that all of its idiosyncrasies vanish into familiarity.

First, the negative side:

  • I’m skeptical of the value of optional parentheses in method invocation.  I see how being able to omit parentheses in a call to a setter method makes it look more like straight assignment, and that’s pretty cool.  But other than that, I see nothing clearer or cleaner about “o.do_something a, b” than, “o.do_something(a, b)”.  Given the numerous situations in which confusion can arise with the rules about when parentheses can and can’t be omitted, I think it’s highly debatable whether optional parentheses are a plus.
  • Method aliasing.  I have not gone through the chapter on meta-programming yet, which is where I think the real justification for method aliasing comes from.  However, in regular-old-programming land, having multiple aliases for methods sucks.  The claim is that it makes the language more expressive because you can define a name for a method that fits the use case better.  An example is the Range class’ include? method which also has the alias member?.  To me, a method that needs aliasing is a method that wasn’t properly named in the first place.  It’s also just more complexity than necessary.
  • “do” and “end” as the conventional block-delimiters for large blocks.  Ugh.  I guess Matz must have been an avid shell-scripter.  To me, this is just bad usability.  The C family of languages (and Perl!) got it right with { and }.  There’s a symmetry there that mirrors their logical function, they are commonly used as delimiters for a set in mathematical notation, and what is a block but a set of statements or expressions? Plus, the construct of a block is something you will be typing over and over and over.  Why do we have to type a total of five characters to delimit it?  “do” and “end” doesn’t really flow nicely, and it doesn’t even come close to mimicking any sort of natural language expression.  I don’t see where it adds any clarity.   Sigh.  However, I’ve come to like Python’s rather individual use of significant whitespace, so perhaps I’ll come to like this as well.
  • Constants that are not enforced as constant.  We have a name for this where I come from: global variables.

On the positive side:

  • I like the use of $, @, and @@ prefixes on variable names to indicate global, instance and class scope.
  • The ability to pass arbitrary blocks to methods is an interesting approach to functional programming.
  • The little I’ve seen of Ruby’s reflection abilities looks like they enable you to do more than Java’s reflection API with fewer lines of code. That may be dangerous, but it certainly looks like fun.
  • Modules!  Yay!  I’m sick of writing utility-style classes with static methods in Java and then playing tricks to keep people from instantiating them.

I will try to write a follow-up after I’ve used the language a bit more.  I’m sure I’ll disabuse myself of some of my criticisms along the way.