Kung fu coding

(check out the video from about 30 seconds in case this post gets a bit dry and drifting)

I find it funny that programmers still generate code by tapping buttons on a keyboard. Code, unlike normal prose, is highly structured with a relatively tiny lexicon. We make up notation like curly braces and semicolons to show this structure to the computer. To help ourselves, we graphically highlight the structure using tricks like indentation and syntactic colouring. Code editors also do their bit with tab-completion to select entities and block folding to hide structural complexity away. Spelling mistakes, dodgy formatting and syntax errors inevitably creep in nevertheless. Is there a better way?

When you recognise code is effectively built rather than typed then graphical environments are the natural way to go. Far beyond representations such as the Block Editor in Google Apps Inventor and Visual Studio Architecture views, I’d love to see the development of a fully-fledged, expressive and scalable software visualization model.

More than that, this representation prompts the use of a new interaction model based on physical gestures. Crack a method open to check it’s innards. Tug a variable to see where it is declared. Pinch for a breakpoint. Much of coding is actually exploring to see how it all fits together. That’s why I’m excited by demos of Kinect hacking like this:

The range of gestures that you can express with your whole body (or even just the upper part!) is far richer that you can get out of a keyboard and mouse. This ought to make interaction more efficient and, I suspect, satisfying. The ergonomic improvements over slouching in front of a keyboard and screen should not be underestimated.

Peering even further into the future, I look forward to the blooming of a sub-field of HCI based around physical gestures. I like to imagine it’ll converge on something resembling Tai Chi, combining efficient, expressive and intuitive movements that are also highly ergonomic. It wouldn’t even be surprising if different camps emerged, akin to the different martial art styles. Hopefully this will result in healthy, chilled-out geeks that happen look ultra cool in movies.

Code ninjas might even start looking the part.

5 thoughts on “Kung fu coding

  1. Noooo…. I totally agree that code is “built”, but it’s also expressed in language. Sure we could build some complex diagrammatic language, but I’m a big fan of keeping it simple with plain text representations.

    What we need is better tools to automate the “text building” around the structures that exist in the chosen language, e.g. flexible extensible snippet templates and editors that understand the syntax. See this for some early examples of this:

    1. I agree with Simon. I also think it’s quite short-sited to assume that the way forward to to try and refine our current approach of describing programs using text.

      In the mean time, there are some great ideas coming out, moving beyond what we all currently use day in day out (i.e., Vim/TextMate/Eclipse).

      See for example LightTable, which has its own Kickstarter project: http://www.kickstarter.com/projects/ibdknox/light-table

  2. I watch that video and I see a collapsible tree structure, spatially-separated and colour-coded functional entities, complex keyboard sequences and fairly regular typos.

    If you are restricted to a keyboard and a colour terminal this is probably converging on an ideal development environment. My argument is that new HCI models allow us to present the same structure much more flexibly with more natural interaction.

    1. I fail to see how waving my arms in the air could ever be anywhere near as expressive as a keyboard… I think I’d end up trying to find the miniscule sweet spot on a virtual shower dial to get the right temperature.

      1. I didn’t realise you could nest replies – awesome! One up on Google+ there…

        Anyway, I’m just lazily extrapolating from the cursor keys through the mouse and touchscreen interfaces.

        Whatever works for you!

Leave a Reply to Pete Lewis Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s