Coding Horror

programming and human factors

Will Mouse Gestures Ever Be Mainstream?

Darwinia is the third game I've played with mouse gesture support:

  1. Bungie's classic 1998 game Myth used gestures in a limited way to indicate squad facing post-movement.
  2. Lionhead's 2001 game Black and White used gestures to invoke various spells.
  3. Introversion Software's 2005 game Darwinia offers gestures as an alternative control scheme.

I've never been comfortable with mouse gestures in any of these games. It seems like a great idea in concept, but it breaks down in execution, at least for me. I distinctly remember the awkwardness of getting my squads to face the right direction in Myth. And although there was a certain element of mysticism in scrawling spells on the screen in Black and White, the game sometimes had difficulty recognizing what I had drawn. It ultimately ended up feeling like extra work when I could have simply clicked an icon or pressed a key to cast the very same spell. Perhaps problems like these are why mouse gesture control mode is not the default control mode in Darwinia.

Games tend to be experimental when it comes to UI. But mouse gestures are slowly-- very slowly-- making their way into mainstream operating systems and applications:

  • There's a plugin to add gesture support to Firefox
  • Strokeit offers system-wide gesture support in Windows
  • The Opera browser natively supports gestures
  • Sensiva provides system-wide gestures for Tablet PCs
  • There's a plugin that brings gestures to Internet Explorer
  • Here's sample code that demonstrates how to add gesture support to a .NET app

Even without any of this software installed, you can use one very familiar mouse gesture: dragging and dropping.

I've experimented with several of the above utilities at various times, and I'm still ambivalent about mouse gestures for a few reasons:

  • Gestures have the one-button mouse problem. There are zero visual cues that any of these fancy gestures are possible. Additional buttons on a mouse, or toolbar buttons on the screen, can prompt a "I wonder what this does?" reaction from a new user. There is no such discoverability for mouse gestures.
  • Gestures are extremely mouse-centric. Have you ever tried "writing" your name with the mouse? Very few users have that kind of fine motor control. But the mouse isn't your only option. Left-hand keyboard accelerator keys can be just as effective-- without requiring you to take your other hand off the mouse.
  • There are only so many gestures you can draw. Once you get beyond a dozen simple strokes in the cardinal directions (up, down, diagonal, etc), you're in trouble. It's a slippery slope to something overwhelming like Graffiti.
  • Gestures require a dedicated accelerator key. There's no way to automatically detect a mouse gesture; they have to be manually initiated via a button or keypress. In most apps, you hold down the right mouse button to begin your gesture, then release it when you're done. It's one more accelerator to remember. And it's now possible to accidentally trigger a gesture when all you wanted was the right-click menu.

In short, gestures are for extremely advanced users only, perhaps even more so than traditional keyboard shortcuts. But they do have some specific uses that are interesting:

"The motion of performing a gesture is more natural than sliding the mouse over to a button or menu," he said. "And because it works anywhere in the window (not just on the button), it saves a bit of time and effort, especially as screens get bigger and you have to move farther to reach a button."

Rather than mousing over and clicking on the relatively small minimize, maximize, or close buttons, it's faster to invoke a gesture right where your mouse is to perform the same action. This is particularly nice when the gesture has some conceptual mapping to the activity: drawing a diagonal slash to close, down to minimize, up to maximize/restore, etcetera.

A mouse gesture on the Wikipedia page (close window)

For mouse gestures to become mainstream, they need to be simple, discoverable, and most definitely system-wide.

Discussion

Darwinia

One of the most amazing gaming experiences I've had in recent memory was playing Introversion Software's Darwinia.

Darwinia screenshot

It's a bit difficult to explain, but the game is a cross between Tron, Syndicate, Populous, and Lemmings. It has a distinct, beautiful retro style all its own. And the music is fantastic. You can sample some of the Darwinia soundtrack at the Trash80 site; try Pain Fade Down to start.

It's an incredibly immersive experience. I actually began to care about Dr. Sepulveda and the tiny, fantastical Darwinian world he created. Darwinia has garnered highly positive reviews not just from me, but from everyone; here's what GameSpot had to say:

Darwinia is a deceptively simple, poignant real-time strategy game wrapped in an abstract, minimalist veneer that somehow manages to make perfect sense within the context of the game. It's a brilliant and addictive experience that's unlike anything you've played before.

One of the many clever touches in the game is the way it alternates through nine different bootloaders at startup. One is a darwinian version of Life, others emulate classic boot screens -- including an old-school 8-bit pirate crack loader!

Darwinia intro: Matrix

Darwinia intro: old-school ray tracer

Darwinia intro: crack loader

The UI for the game is also outstanding. It supports mouse gestures and uses Fitt's Law to drive the control and status overlays.

I highly recommend the Darwinia demo. If you enjoy the demo, purchase the full game through Valve's Steam download service or on CD direct from Introversion. If you decide to buy, you'll want to read through the faq, too.

Introversion's first game, Uplink, was released in 2001. It's essentially a hacking simulator. I played it a little bit; it's unique but ultimately too repetitive. Their next game, Defcon, should be out sometime this summer.

Discussion

Choosing between .NET Pepsi and .NET Coke

I've increasingly come to believe that the debate between C# and VB.NET is a red herring. Choosing between C# and VB.NET isn't a meaningful choice. It's like choosing between .NET Pepsi and .NET Coke.

Pepsi vs. Coke

Either way, you're getting a cola flavored carbonated beverage.

If C# is Coke and VB.NET is Pepsi, then Python is Yoohoo. It's more than mild differences in syntax. It's a completely dynamic language with Duck typing where indentation is used in place of squigglies or End statements.

Wasn't this the promise of the .NET runtime-- that we'd have real, meaningful choice of language? That's why I'm so excited about IronPython. IronPython has been a fine proof of concept, but it had no IDE integration. Until now.

As documented in Aaron Marten's blog, the latest CTP of the Visual Studio SDK finally makes Python a first-class citizen in the Visual Studio 2005 IDE:

Visual Studio 2005 New Python Project

And here's the requisite Hello World example:

Visual Studio 2005 Python 'Hello World' Project

I can't see any obvious way to build a web or winforms app in Python yet. But it's coming.

Discussion

Colorization Required

Black and white works fine when I'm reading newspapers. But when I'm reading computer languages of any kind-- from Perl to SQL, from C# to Regular Expressions, from HTML to XML -- I can't bear to read them in black and white any more.

Consider this Infocard XML as you'd see it in a basic Notepad style text editor, perhaps with a little line numbering:

Infocard XML

It's just a slew of angle bracket noise that makes my brain hurt. But if view the same file in an editor that can colorize the XML..

Colorized Infocard XML

.. all of a sudden we can clearly see what's going on.

Plain old Notepad is perfectly adequate for reading text files. But if you're reading code or markup of any kind, Notepad doesn't work very well. We need colorization to truly understand what we're looking at.

Why is that? Are we just spoiled?

Discussion

The Real Cost of Hello World

The archetypal Hello World program has always had a calming effect on developers. It's been a programming staple for decades:

[Hello World] is typically one of the simplest programs possible in a computer language. Some, however, are surprisingly complex, especially in some GUI contexts; but most are very simple, especially those which rely heavily on a particular command line interpreter ("shell") to perform the actual output. In many embedded systems, the text may be sent to a one or two-line LCD. In yet other systems, a single LED may be turned on.

A "hello world" program can be a useful sanity test to make sure that a language's compiler, development environment, and run-time environment are correctly installed. Configuring a complete programming toolchain from scratch to the point where even trivial programs can be compiled and run may involve substantial amounts of work.

While small test programs existed since the development of programmable computers, the tradition of using the phrase "Hello world!" as the test message was influenced by the 1978 book The C Programming Language. The example program from that book prints "hello, world" (no capital letters, no exclamation sign; those entered the tradition later). The book inherited the program from a 1974 Bell Laboratories internal memorandum by Kernighan -- Programming in C: A Tutorial -- which shows the first known version of the program.

Wikipedia also has a ridiculously comprehensive list of Hello World programs in hundreds of programming languages, some of them extremely esoteric (read: joke) languages.

On the Great Win32 Computer Language Shootout page, amongst all the various benchmark tests, there's even a Hello World performance test :

Hello World performance graph

Of course, it's a completely useless performance test. But that's very much in the spirit of Hello World.

Discussion