Voice recognition is getting better, and it's increasingly being used for more than just reminders and email. But can you use it to help you code? Maybe. The loquacious coders at Stack Exchange chime in.


I'm looking for ways to augment mouse and keyboard control with another form of input. Is there a way to use something like Dragon to trigger macro expansion? For instance, can I create a voice command to write a loop template?

See the original question here.

I wrote a system using a similar approach created by Tavis Rudd, a strong proponent for using voice to code, and I've now been using it for a few weeks. Basically, it runs Dragon with NatLink and Dragonfly in a virtual machine and executes the actions on my Linux system. It's definitely still duct tape coding, but I'm quite happy with the preliminary results. You can check it out on GitHub. Much of the code there should be of use with just Dragonfly on Windows with only minor changes.


So is it working? I am not faster dictating than typing code. But I am faster with a combination of voice and keyboard, and at any rate I spend enough time pausing to think that a small slowdown in code entry due to voice doesn't have much of an effect on overall productivity. And I'm sure with more work I can improve.

Tristan Hayfield also recently posted about a similar project on the Dragonfly group.

You may also want to take a look at VoiceCode. I have played with it a bit, and while it wasn't really what I was looking for, it's a very interesting project.

There's definitely a lot of promising stuff floating around, but at present you need to be prepared to do some substantial customization and hackery of your own in order to get a system working that you'll be happy with.


I think the power and potential of voice activation tools lies in using spoken word to trigger actions and events, but not to replace typing.


For example, if you can configure a voice recognition package to trigger commands like "open," "save," "build," "run," etc., then you can save yourself time hopping through menus or typing hotkeys.

However, I wouldn't recommend putting much effort into using voice recognition to actually generate your source code, keyword-by-keyword. Unless you are a very fast speaker or a very slow typist, you probably won't be able to increase your speed, accuracy, or overall efficiency much by this method. Imagine having to say "dot," "open-bracket," "semi-colon," and so on every time you need the special markup characters that are so much more prevalent in programming than in prose. Without a highly specialized approach (one that will take much more effort than tweaking a package like NaturallySpeaking), I doubt you will increase efficiency.


However, one of the most promising areas of increasing efficiency as a programmer is in avoiding context shifts. For example, doing as much as possible without removing your hands from the keyboard by using hotkeys instead of mousing helps programmers stay focused and effective. A voice activation system might be effective if it reduces the amount of time spent using the mouse and exiting your active program, but trying to replace typing with speaking does not sound likely to make coding any easier.

Master Your Existing Tools Instead ( Answered by Dave Newton

In my opinion, voice input for programming is likely to be substantially less efficient than typing, particularly in an decent editor with good macro and template facilities. I think you'd be better served figuring out the domains you normally work in, what code generation tools you already have access to or can create, and nailing down every possible keyboard and template efficiency you can find.


Programming vocabulary is specialized and focuses on a different set of terminals than usual speech does. Context-sensitive and language-sensitive editors have access to the abstract syntax tree of whatever language, environment, and framework you're working on, while Dragon and other such voice input software does not.

This is something I've played with every couple of years for over a decade now, and it rarely takes more than an hour or two before I give up. The abstractions we deal with as developers simply don't map well to the English vocabulary. Even using voice macros, I personally have yet to see a system, or combination of systems, that doesn't make me want to punch my monitor in the face.


Disagree with the answers above? Leave your own answer or submit a comment at the original question . See more questions like it at Personal Productivity Stack Exchange , a question and answer site for people who want to live more efficiently. And if you've got your own question that requires a solution, ask . You'll get an answer. (And it's free.)

Image remixed from Maksim Kabakou (Shutterstock) and Ljupco Smokovski (Shutterstock).