Weekly Roundup

Was much busier this week and wasted less time on the internet. But! Here are my favorite links from this week:

Have a great weekend.

Rebuilding Doug Engelbart’s Chorded Keyboard

In 1968, Doug Engelbart made The Mother of all Demos where he showcased the world’s first computer workstation that had a mouse, keyboard, and graphical user interface. It’s long but it’s worth a watch, mostly because it shows how many of Engelbart’s ideas persist to this day.

There were a couple things that fascinated me about this demo. Doug used what he called a chorded keyboard, which was a sort of five-key piano-like device that sat to the left of the normal keyboard:

enviboard

Here, he explains that the device has 5 keys because humans have five fingers, and that it’s possible to map the binary digits to your fingers and thus the chorded keyboard provides 32 possible “chords” that can be played with two fingers:

If you watch the original 1968 video, you can see that Doug used the combination of the GUI, this chorded keyboard, and the mouse to use software in a way that was nearly modeless and involved the use of both hands. It allowed the user to issue commands to the software by pointing, clicking, and playing a chord simultaneously that performed some desired functionality. It reminds me a lot of playing a musical instrument.

Several years ago I became a little obsessed with trying to duplicate this device. It turns out that nobody makes anything like it. The best I could do was to buy an Arduino, some pushbuttons, and try to make one myself.

For posterity, here’s the code for my device: https://github.com/dpaola2/ChordedKeyboard. I followed this tutorial to set up the Arduino as a USB keyboard in OS X, which required using a driver from this repository.

Essentially, I put five push-button components onto a small breadboard and connected them to the arduino. Then, in the main loop of the arduino board, I polled the 5 pins for their values and treated them simply as binary (which was really not difficult) and emitted them to the computer via the homemade device driver.

Because our software today doesn’t work in precisely the same way Engelbart’s NLS system worked, I wasn’t able to “play” the computer as he did. But it was a fun project and I learned a lot. Maybe someday I’ll write some software that takes the idea a little bit further.

Here are the photos of my chorded keyboard:

 

ORM Hate (Martin Fowler)

My highlights from OrmHate:

The charges against them can be summarized in that they are complex, and provide only a leaky abstraction over a relational data store. Their complexity implies a grueling learning curve and often systems using an ORM perform badly – often due to naive interactions with the underlying database.

I think that if you’re going to dump on something in the way many people do about ORMs, you have to state the alternative. What do you do instead of an ORM? The cheap shots I usually hear ignore this, because this is where it gets messy. Basically it boils down to two strategies, solve the problem differently (and better), or avoid the problem. Both of these have significant flaws.

This is where the criticism comes that ORM is a leaky abstraction. This is true, but isn’t necessarily a reason to avoid them. Mapping to a relational database involves lots of repetitive, boiler-plate code. A framework that allows me to avoid 80% of that is worthwhile even if it is only 80%. The problem is in me for pretending it’s 100% when it isn’t. David Heinemeier Hansson, of Active Record fame, has always argued that if you are writing an application backed by a relational database you should damn well know how a relational database works. Active Record is designed with that in mind, it takes care of boring stuff, but provides manholes so you can get down with the SQL when you have to. That’s a far better approach to thinking about the role an ORM should play.

I’m guilty of trash-talking ORMs but I also am a huge fan of ActiveRecord. I appreciate Martin Fowler’s ability to articulate the advantages and trade-offs of the ORM and also the other approaches.