Archive for 5th April 2006

Functional vs. OOP

Something I’ve been finding myself doing:

 

class Foo{

  int someState;

 

  static int Bar(int state)

  {

    return state * state;

  }

 

  public int Bar()

  {

    return Foo.Bar(someState);

  }

}

 

Essentially, developing my code in a functional manner (easier for unit-testing) and then refactoring a simpler public interface. Waddya’ think?

“Meltdown expected”? Fetch me my cattle prod!

A cab rider was detained for singing along to the Clash song “London Calling.” Geez, lucky he wasn’t singing “Guns of Brixton

Gawd. I am so happy I’m not a teenager today. Given the bands I liked, I’d probably be in Guantanamo by now. I know that some of the stuff I wrote would have got me expelled.

I’ve always felt fortunate that I wasn’t caught doing a bunch of stuff I did as a teenager, because instead of just working things out and becoming a pretty darn mellow guy, I know that it would have been like hooking a fish and I just would have rebelled much more … well, I dare not say “violently” or “extremely” lest I risk extraordinary rendition … so let’s just say that I would have been even more of an insufferable know-it-all rebellious teenager.

I mean, I was just mad at Reagan and nonsense like missile defense, invading Grenada, and supply-side economics. Small beans compared to today’s hypocrisy, corruption, value destruction, and delusional foreign policy.

Crossing the Chasm: Programming Languages Edition

Geoffrey Moore’s Crossing the Chasm is the best explanatory text of why tools succeed in the software development world (its scope is broader than SD, but SD is smack in the middle of its explanatory power). The basic idea is that dividing the world into a bell curve of innovators, early adopters, early majority, late majority, and laggards is useful, but misses a crucial "chasm" that exists between early adopters and early majority:

The gap exists for many reasons, but the major one is that what innovators and early adopters value and expect (with development tools, such things as expressiveness and high productivity but at the cost of learning something new) differs from what the majority values and expects (ease of use, integration). Java crossed the chasm, Smalltalk didn’t.

 

Will Ruby? Well, it’s going to be a challenge. If my theory is right, the “rapid inflation” that Ruby is currently undergoing is indicative that it’s broken out of “innovators” and is in the “early adopters” phase. So “the chasm” is looming. Right now, Ruby doesn’t have the toolset to appeal to early majority and, equally importantly, the Ruby community does not currently “speak to” the concerns of the majority (“Who else is using this?” “What about my existing investments?” “You mean, I have to train everyone in a new language and standard library?”).  A huge problem in terms of “the chasm” is that Ruby interoperability with the CLR and the JVM is “early adopter”-style via bridges/interop. That’s not going to cut it with the majority – if it’s not integrated into Visual Studio or Eclipse, with full Intellisense, it’s not going to make it across the chasm.

 

This is one reason why I think there’s such a golden opportunty for “DevCo” – the ex-Borland languages division — with Ruby. “DevCo” has expertise with “majority” issues: IDEs, integration, support, databases, etc.

Use Eiffel for OSS, Get The IDE for free

Eiffel Software, makers of the Eiffel programming language, have made their IDE EiffelStudio available under a “dual license.” Use it for commercial software, pay; use it for OSS, get it for free. Interesting idea and a good opportunity to see why Eiffel is a well-respected language.

Well-respected, but never very popular. It’s interesting to look at Eiffel as an example of a language that’s failed to gain more than niche attention. Not that niches are necessarily bad — ISE / Eiffel Software has been around since the early 90s and is based in Santa Barbara, which is certainly one of the nicest places in the world to live.

But why is Ruby (say) increasing in popularity while Eiffel doesn’t show any signs of groundswell? It’s not that Ruby’s new — it’s been around for more than decade now. While programming languages often take several years to achieve popularity, Ruby is quite long in the tooth. I don’t see in Ruby any particular features “whose time has come” the way that C++ and Smalltalk blossomed at the turn of the 90s as OOP came roaring into the mainstream.

There are 3 things that I think you could propose as reasons to explain Ruby’s increase and Eiffel’s “failure to achieve orbit”:

  • explicit / implicit typing. I don’t think this has much to do with it, but I’d be remiss not to mention it;
  • Rails. The console world had “Hello, World,” the GUI world had the Rolodex form, and Rails has “scaffolding.” While none of these are typical of day-to-day programming in that world, each is a heartening quick start that lifts the spirits of those immersed in that world. The Rolodex form was most impressive to people who hadn’t mastered Win16 and led to the success of Visual Basic. Rails’ “scaffolding” code is not going to get you through your project, but the impression it gives is much better than the impression of Visual Studio opening a blank Web page and saying “Drag components onto the form.”
  • Pragmatic Programmers LLC. Bertrand Meyers “Object-Oriented Software Construction,” is a book I keep as a definitive reference. But it’s hardly a “fun” book to read and it wasn’t followed up by a stream of other Eiffel-touting books. I think that Pragmatic Programmers and Ruby are in a feedback loop: the release of more Ruby books gives the impression of rapid growth which, in turn, attracts the attention of early adopters and younger programmers. You need a period of “rapid inflation” for a language to make it to the next level and I don’t think Eiffel ever had that.

Saying that a flurry of books is important to language popularity flies against the common wisdom that dead-tree publishing has become a lame duck. But if you went back two years, what would make you think that success would come to Ruby and not, say, Haskell (another language with a vocal Internet fanbase)? I don’t think the answer is in the syntax of the languages.