Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I make a lot of typing mistakes when I program. I have a good keyboard writing speed but I try to write faster and in the process end up making typos.

I want to type faster, but make less errors. Can I do something to improve the situation?

share|improve this question
    
What tools are you currently using as part of your development process? –  Thomas Owens Mar 13 '12 at 14:27
    
Do typing errors occur mainly when writing code or other areas like email? Because if this is a general typing skill issue, it's off-topic. –  JeffO Mar 13 '12 at 14:33
2  
Well, it's not like the typing is the critical component of programming. With intellisense, auto-complete, wizards, clipboard, and average of few LOC per day... As long as you don't mix numbers in loops. –  Coder Mar 13 '12 at 16:18
7  
The real solution is to type slower until you reprogram your muscle memory. Then once you don't make typos anymore, you can work on increasing speed. At least that's how we taught typing. (I can't believe I ever taught typing as lousy a typist as I am!) –  HLGEM Mar 13 '12 at 20:03
1  
Use a dvorak keyboard? –  mowwwalker Mar 13 '12 at 21:45

14 Answers 14

up vote 19 down vote accepted

Make sure you use auto-completion/Intellisense wisely if you're using an IDE or (I suppose) some text editors. If you use them well, you only have to get the spelling correct once :)

share|improve this answer
4  
Now I ty wit to mny missng charcters #intellisense-addict . But seriously, good auto-completion, the one where you can do click-click-tab click-click-tab to write a line of code, can really help reduce spelling errors by a really large margin and usually as a bonus they'll make many class of syntax errors more obvious as well. –  chakrit Mar 13 '12 at 14:59
    
Emphasis on the 'wisely' here. Auto-complete is a great way to speed things up, it's also a great way to call the wrong methods, use the wrong variables, and generally make hash out of your code. –  Michael Kohne Jun 17 at 11:29

I play music, and I am pretty sure that typing without errors is not much different than playing a song without making mistakes.

Please have a look at that answer to the above question. Basically, it is not only sufficient to practice your typing skills, you should try to practice well.

Of course, you rarely practice a single piece of code in order to give a performance ("Carnegie Hall, Sat. 8AM: Quicksort Concerto by D. Knuth"). You are likely to improve your typing skill while writing and committing code:

  • Next time you have the time (not before a deadline) start writing slowly and try to make no error (no typo). The goal is to write as fast as possible while being perfectly correct. Be mindful of what you are doing in order to break from your current habits.
  • When you make a typo, don't just correct it (doing so, you will learn to write bad and correct quickly), but erase and retry the whole sequence.
share|improve this answer

If I may suggest:

Get a great keyboard

A mechanical keyboard.

After reading Jeff's Post about mechanical keyboards I decided to buy myself a mechanical keyboard as well. Not only am I firmly convinced that it speeds up typing and has a great ergonomy, it also noticably reduces typing errors I make.

Secondary Advice

Do you know your keyboard layout? Can you type without looking at the keys? If so, get a keyboard with the labels removed. Lose the dependency, the lack of confidence in where each key is situated. It's daunting at first, and, much like Vim and other rewarding editors, it will pay off greatly in the future.

Tertiary Advice

This is anecdotal, but I have two modes of typing. My regular typing speed, and the fast typing speed. I type fast to increase my regular typing speed. I do not type fast to code fast. I type fast to learn typing faster while I'm typing slower. My advice for you is to not type fast, but to type regularly and improve with dedicated, directed practice.

share|improve this answer

Every time I made a typo I copied the offending sentence into a file. After a few months, I analysed all the typos I made, grouped them into categories and gave each names (for example confused-order-letter (lettre for letter) , the missing repeated section (imag(in)ing). I found that having names for each enabled me to better spot errors that occurred in future.

I wrote about my experiences and included my taxonomy of typos on my blog.

share|improve this answer

I don't recommend to widely depend on IDEs. Of course they're really good helpers but still you should be able to work within any environment as needed. So making typos is a general problem instead peculiar to coding. One should fix this problem making practices at least 30min a day. Typing won't help if you don't do it to improve yourself. You should find techniques which can help you to improve it otherwise you will end up making mistakes for the rest of your programming life. You should teach your brain how to type faster and better than that, effectively.

And I also agree with the answer mentioned here http://programmers.stackexchange.com/a/140182/3613 and one should slow down when making mistakes goes crazy and make a rescan your memory, check the keyboard again and let your brain re-visualize the location of the keys and besides give yourself a break. As your brain gets tired, it will start coming off and it becomes not just typing problem and also focusing problem and it means bugs are on the way to invade your codes.

But remember sometimes focusing too much on the keys and what's coming from your brain (code statements) can hurt your brain and make you feel tired even earlier and faster so as I mentioned giving a break is a the key thing here.

share|improve this answer

Simple: Slow down ;). You probably make typos because you try to type as fast as you think, or try to type code as fast as possible. The only way to reduce the amount of typos you make is to practice; slow down your typing, until you actively think about every key you hit - and never make a mistake again. Speed up from there. Slow down when you make typos again.

(Note: This is not my answer, it's how I learned to drum: slow down so you can actively think about which foot / arm to move next. Repeat until it becomes a natural / automated motion)

share|improve this answer
    
I totally agree with you. I always try to type faster like I think but it seems my fingers cannot catch up with my brain and I have slow down and get pace once I can visualize where the keys are located. And typos are really becoming irritation once you make a lot of them. One of my senior co-workers (senior in age) told me your brain thinks faster than your fingers :) –  MoonLight Mar 19 '12 at 17:52

Editors such as vim have mapping that allow you to change a word into another word. For example:

map teh the

will change all instances of teh into the as you type. The user need not even know that they typed "teh" as it will only appear for less than a second before being changed to "the".

share|improve this answer
    
There are some other nice commands--in Emacs, if you accidentally typed typed the last two characters backwards (e.g. na instead of an) you can flip them with C-t. –  Tikhon Jelvis Mar 13 '12 at 21:03
    
I'm not sure quite what you mean. This particular command just transposes two characters. I just find it useful for fixing my most common typo when programming. –  Tikhon Jelvis Mar 14 '12 at 7:36
    
Ah, that's neat. I thought it was just a command you ran. –  Tikhon Jelvis Mar 14 '12 at 7:54
    
@TikhonJelvis: Question edited from comments and comments removed. Thank you. –  Sardathrion Mar 14 '12 at 7:57

One trick I adopted a long time ago involves testing variables for equality in 'C' and other languages that use '==' to test for equality and '=' for assignment.

I always used to write something like:

 if ( X == 10 ) { ....

and so whenever I'd miss a '=' and accidently write:

 if ( x = 10 ) { .....

I'd be ferschnoggled for a while. The condition is true, the statement compiles & runs, the variable gets changed when I ddin't want it to be, etc. Then somebody told me to write the constant first! ex:

 if ( 10 == x ) { ....

That way, when you forget to type a '=', the compiler tells you you're being stupid!

share|improve this answer
3  
"Yoda Expressions" less readable I find, although practical perhaps. –  Wesley Murch Mar 13 '12 at 20:30

If your IDE has syntax colouring, most typos will give you immediate visual feedback. When you successfully type int it changes colour as soon as you press space. When you mess up and type nit it does not. The immediacy of this feedback should, if you care about reducing typos, help you to avoid errors.

So three suggestions:

  • use an IDE that gives you the maximum feedback as you type
  • use an IDE that autocompletes so you don't have to type so much
  • pay attention to the quality of your typing and it is likely to improve

Don't worry so much about being fast. Fast will come later. It's true in typing as in code, that while performance is a feature, correctness is mandatory. :-)

share|improve this answer
1  
+1 for immediate feedback. Contrary to all the doom and gloom about how the rise of word processors with spell checking in my early teens was going to create a generation that would be forever incapable of spelling correctly; MS Word's spell checker and (in later versions) red squiggles did far more to improve my spelling than any of my teachers ever did. –  Dan Neely Mar 13 '12 at 19:39

Without knowing what tools you are using, I can't give specific, detailed advice, but consider using more automated solutions.

Integrated Development Environments will provide you with a number of features that should help alleviate your problems. Examples include code completion for method names and variables, sorted views over the various members of your classes, built-in documentation, and in most cases the ability to spell-check at least your comments. Also, code generation might help with tasks such as importing/including the right files, generating boilerplate code, and so on. Minimizing the amount of typing that you do would minimize the opportunities for you to make typing errors.

Of course, it might be an option to just simply slow down. It's not a race to the finish. It's common knowledge that preventing mistakes early is preferable to finding them later and needing to fix them. If you are using tools that can prevent, detect, or fix mistakes, you'll save time when you produce your outputs - no more typos leading to compile errors, for example.

share|improve this answer

contrary to joshin4colours answer, I say the opposite is true. Intellisense is great as an aide, but it will not improve your typo's. It will just make you target a different set of keywords ;)

so:

practice makes perfect go play a typing game

share|improve this answer
2  
Or better yet, phoboslab.org/ztype –  chakrit Mar 13 '12 at 15:00
1  
But what's the goal? Reducing the amount of typos or increasing the correctness of the code? If it's the latter, then auto-completion is a perfectly valid tool. –  Joachim Sauer Mar 13 '12 at 15:02
    
@JoachimSauer: When typographical errors make their way into the code, then Intellisense just compounds the error. I used to work on a codebase where the Event object had been mis-typed as Evnet... and no one noticed (?!?!) until too late. Admittedly tools like Resharper have smart re-name... but that extra work could be reduced by not typing it incorrectly the first time. I agree, however, that this is a secondary consideration; auto-complete / intellisense is first. –  Peter K. Mar 13 '12 at 15:09
    
@Darknight I guess there's a couple of questions here: how to become a better typist (practice!) and how to avoid typos (avoid typing!) :) –  joshin4colours Mar 13 '12 at 16:32

I suppose its a bit obvious, but I think practice makes perfect is what you should remember here. I am not a big time coder in any sense, but I do some work in R, VBA, VB.Net and a bit of C# and you could essentially plot my increase in speed and decrease in errors as a function of time and the number of projects I had done in that language. The first time I wrote something in vb.net to automate excel or fit a model in R it was an ordeal that was full of mistakes, but now I can sit down and bang out simple office automation very quickly and the number of mistakes I make in a fraction of what it was.

I think there is also a bit of a recency effect. If I take a few months off of a particular language (or worst case scenario, coding in general) the first projects I do on my return are quite painful, but it comes back pretty quickly.

share|improve this answer

There's nothing for it but to practise. Jeff Atwood wrote a blog post on the subject a while back. Mavis Beacon software is still around so that's a good place to start, but I'm sure there are plenty of free, online resources to be found.

share|improve this answer

The only thing that will make you type correctly more often is to practice. Or to make errors very painful, as those of us who started on punched-cards might remember - a single keystroke error usually resulted in retyping the entire line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.