Sugar leaves the One Laptop per Child nest

May 16, 2008 under usability, hci, olpc

Sugar Labs logo

It’s been an interesting 24 hours for anyone who follows the One Laptop per Child project. Yesterday, OLPC announced that they have teamed up with Microsoft to make Windows XP available on the XO. Then it was announced that Walter Bender, OLPC’s former president of software and content, is forming a new organization called Sugar Labs to spearhead development of the Sugar user interface.

This is an interesting development. I started working on OLPC-related projects a few months ago, doing some work on the user interface for the built-in graphics tablet. Back in January, I wrote about how cool I think the Sugar UI is. I really hope that Sugar can gain some momentum on its own, instead of constantly being overshadowed by the political and ethical issues of the One Laptop per Child project as a whole.

I’ve been thinking about buying myself some kind of ultra-portable laptop, and since I find it almost impossible to type on the XO keyboard, I’m currently eying the Asus Eee PC. I don’t think it makes sense to use a conventional desktop environment on that kind of machine, and I think that the current Sugar UI is a really promising alternative. Now that Sugar is being developed separately from the OLPC project, it will be interesting to see if it can develop into a useful general-purpose desktop shell.


This is my brain on Twitter

May 7, 2008 under meta

In case you just can’t get enough of me on this blog, I’m pleased to announce the following:

Since all my other plans fell through, I decided to show up to the Twitter party (fashionably late, of course). You can get your Dubroy fix in bite-sized chunks at http://twitter.com/dubroy. Hope to see you there!

And from time to time, I bookmark things that strike my fancy at http://del.icio.us/pdubroy. Most of the links are relevant to this blog, so I try to post a link roundup here every now and then.


Technorati Tags: , , ,

If this is Object Calisthenics, I think I’ll stay on the couch

May 6, 2008 under programming

Via Raganwald, I saw this post by Andrew Birnstock: Perfecting OO’s Small Classes and Short Methods. The post is a summary of an essay by Jeff Bay called Object Calisthenics, from the new Pragmatic Programmers book The ThoughtWorks Anthology.

“Object Calisthenics” is supposedly an exercise to get you to write better object-oriented code. Reading through the suggestions, I couldn’t decide if the article was serious or not. From Andrew’s summary:

  1. Use only one level of indentation per method. If you need more than one level, you need to create a second method and call it from the first. This is one of the most important constraints in the exercise.

  2. Don’t use the ‘else’ keyword. Test for a condition with an if-statement and exit the routine if it’s not met. This prevents if-else chaining; and every routine does just one thing. You’re getting the idea.

  3. Wrap all primitives and strings. This directly addresses “primitive obsession.” If you want to use an integer, you first have to create a class (even an inner class) to identify it’s true role. So zip codes are an object not an integer, for example. This makes for far clearer and more testable code.

From what I can tell, this really is serious. These are supposed to be the object-oriented equivalent of chin-ups, designed to whip you into shape to write better OO code.

This strikes me as so bogus, I can’t even begin to describe it.

I’m not against OO: I’m a huge fan of Smalltalk, and I cut my programming teeth at one of the oldest object-oriented development shops. In fact, I keep thinking of something that Steve Northover used to say to me when I was on my first work term at OTI:

“That which obscures my code is bad.”

If you’ve ever seen a large body of code that adheres to The One True OO StyleTM — like say, Smalltalk class libraries — you’ll understand that almost every step you take towards “true OO” is just another way of obscuring the meaning of your code. If you break your code up into 10 different methods, then that’s 10 different places I have to look to figure out what is going on. You’re just writing spaghetti code by a different name. If you’re building a very large library, then maybe, just maybe, the additional flexibility is worth it.

I think Paul Graham sums it up best in his essay Why Arc Isn’t Especially Object-Oriented:

My own feeling is that object-oriented programming is a useful technique in some cases, but it isn’t something that has to pervade every program you write. You should be able to define new types, but you shouldn’t have to express every program as the definition of new types.