Programming in a keyboard-less world

Just the other day, my brand new Transformer Prime tablet arrived.  Aside from being a high quality tablet (quad core processor, one of the very first to offer Android 4.0), it is well known for having a docking station accessory, complete with a keyboard, that essentially transforms it from a tablet to a 10 inch net-book.  My phone, a HTC G2, also has a fold out keyboard, as did its predecessor, my old G1 phone.  So I think its safe to say, I am a fan of physical keyboards.  Sure, voice recognition can be good for some things, and Swype produces a nice on screen keyboard, but if I want to type anything of substance, I’m much more comfortable typing it on a nice hard QWERTY keyboard with actual buttons I can press.

Which makes the fact that I’m writing this post a bit ironic.

There was an interesting podcast last week from the IEEE about the keyboard going the way of the typewriter.  Of course I was rather dismayed by the thought.  Its not just that oncreen touch keyboards will replace them, but that new input devices, such a stylus with handwriting recognition or a microphone with voice recognition, will be the computer input of the future.

I would argue we are nowhere close to that with today’s technology, at least from where I stand.  Being that my Transformer keyboard hasn’t arrived, I originally tried to “write” this blog post with my tablet’s “voice keyboard”, and I couldn’t get through the first paragraph without getting frustrated and giving up.  I haven’t really tried using a stylus recently, but handwriting such as mine is typically so bad even I have trouble reading it, so I won’t begrudge any computer program which can’t read it (and before you try to say that’s just because I’m so used to keyboards I’ve lost the ability to write neatly, my grade school teachers would be quick to point out I never had that skill, even before I learned to type).  On the other hand, I can type at a reasonably fast pace with pretty good accuracy, so there is no debate on which method is more proficient for me.

But one argument made on the podcast was that kids today will likely grow up so used to voice recognition and handwriting recognition that they may view keyboards as obsolete.  That they may offer a technically superior method of writing fast will not matter to them.  After all, one could easily argue that command line interfaces can be much more productive that GUIs for many tasks, but outside of hard core hackers, the world has largely moved away from them.  Even software developers have largely embraced tools such as Eclipse as an alternative to hacking on the command line.

And I can’t deny that there are some areas which keyboards are not very good at.  For instance, look at writing math problems.  Math is typically full of Greek letters, superscript/subscripts, and other things which are just plain hard to type.  Sure, there are usually obscure keyboard shortcuts for them, and specialized software for it (such as Mathematica), but no real general purpose solution.  When I was trying to take notes for the Stanford Machine Learning class on Evernote last year, I can’t tell you how much time I wasted trying to come up with notations for random symbols that kept on coming up.

And of course more creative endeavors such as building “mind maps”, that is just hard to do without a more free flow input format.  That’s why many still argue that pen and paper is a superior note taking device.  Keyboards are great for writing lines of text using a small set of well known characters, but are rather limited beyond that.

So as keyboard-less input becomes more and more mainstream, how will that affect computer programming?  Today, programming is a perfect example of lines of text optimized for keyboard input.  Using voice recognition to write a Java program?  How insane would that be?  “For, begin paren, double, no capital ‘D’ double input colon input-capital-V-vals, end paren, open bracket” instead of just typing:

for (Double input: inputVals) {

Case sensitivity, the frequency of special characters and common symbols, terse variable names, camelCase, none of that will work with voice recognition input.  Computer programming is clearly not a place where you want creative, free form input, but you want to heavily restrict it to what are legal values.

Or is it?

Will computer languages evolve to utilize the advantages of newer input methods.  Will they start to incorporate more free-form writing rather than just plain text?  Will it even be possible to come up with languages like that?  Or will future freshman computer science students have to spend hours learning ancient typing techniques that have become obsolete outside of writing programs?

I suppose time will tell.

,

  1. #1 by Leo Jweda on January 30, 2012 - 5:25 pm

    This got me thinking and I think we can come up with voice commands that corresponds programming functions and keywords we use. For example:
    if (inputVal == 3) {
    Can be voice-inputted as “If input val is equal to 3”
    This will “tokenize” the sentence. It’s an if statement so it’ll look for keywords like “is equal to”, “is less than”, “is greater than”, etc… and everything between “if” and any of those keywords gets analyzed as either a single variable or if it’s more complicated like “(user.password == y && user.active)” then it gets parsed separately then put in place.

    This can be done for anything. Take this for loop for example:
    for(int i = 0; i <=3; i++)
    Can be read as "for loop using i from 0 to 3" BAM!

    Or
    foreach (persons as person)
    Well, "for each persons as person"

    Think of how much easier it'll be to write HTML:

    ×
    Holy guacamole! Best check yo self, you’re not looking too good.

    Can be read as “Div class equals alert dash message space warning, div content is, new line, anchor class equals close, H. Ref equals number sign, anchor content is X, end of anchor content, new line, paragraph, paragraph content is strong, strong content is Holy guacamole exclamation mark, end of strong content, Best check yo self, you’re not looking too good period, end of paragraph content, end of div content”

    The idea is to use structured commands rather than spelling it out word/character by word/character. This has the advantage of eliminating spelling mistakes.

    Thoughts?

  2. #2 by Jörg on January 31, 2012 - 3:50 am

    1. With IDE auto-completion typing is way faster than speaking.
    2. Imagine the noise-level created by programming-by-voice-input in an office (most developers have to share office room with other developers).
    3. It’s sometimes hard to focus and think abstract, if the fellow developer next to you is talking on the phone … it must be even more difficult to focus on ones own code, if that fellow is constantly telling his IDE other programming instructions.
    4. Worse yet, ones IDE would sometimes pick up instructions voiced by the fellow developer …

  3. #3 by itoctopus on January 31, 2012 - 7:12 am

    It’s funny I was thinking about the same thing the other day when I bought my Galaxy tab. It’s obvious for everyone that we’re moving into the tablet era, so will we still type to create a program? Only time will tell…

  4. #4 by Waddle on January 31, 2012 - 7:46 am

    Can’t wait to see an open space of 42 “voice-developers”, must be fun !

  5. #5 by Nicholas Watkins Brown on January 31, 2012 - 8:14 am

    On the subject of ambient noise, that shouldn’t be too big of a problem as call centers today deal with that all the time today. You probably wouldn’t want to be speaking in the laptop’s built in microphone though, but instead use a headset.
    And auto-completion is a feature that evolved to make typing code faster because that was the primary way it has been input. If that shifted to voice commands or even drawing, I’d imagine that new features that optimize those input methods would evolve as well.

Leave a comment