Do faster typists make better coders?

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

keyboard

I have been able to touch type since about age 12 and can manage about 100 words per minute when faced with blocks of text to copy and even faster if I am just writing code.

About 15 years ago. I would have been typing.

	LDY 	#0
.loop
	LDA blocka,y
	STA blockb,y
	INY
	CPY #100
	BNE .loop

For those who don’t know this is a small block of 6502 (or in fact 65186) and yes I can still remember how to code in it (somehow!). This meant you were in general only typing alphaNumeric values plus the odd coma and hash. 6502 is quite a long winded assembly language and to write even something simple meant hundreds of lines of code.

About 12 years ago. I would have been typing.

while (*cp)
{
	s1 = cp;
	s2 = (char *) str2;
	while (*s1 && *s2 && !(*s1 - *s2)) s1++, s2++;
	if (!*s2) return cp;
	cp++;
}

Programming in C meant a lot more typing of parenthesis and a lot more thinking about the structure of the code.

Right now I am typing. UPDATE: I have updated the code to something I wrote (see comment)

<div class="boxmiddle">
    <div class="boxmiddletext">
    <?php 
    switch($this->type) {
        case layout::LAYOUT_TYPE_CONTENT:
            echo $this->content;
            break;
        case layout::LAYOUT_TYPE_PARTIAL:
            echo $this->partial($this->name,$this->data);
            break;
        case layout::LAYOUT_TYPE_VIEW:
            echo $this->view->render($this->name);
            break;
    }
     ?>                
    </div>
    <div class="boxmiddleright"></div>
</div>

PHP has introduced another set of typing problems with a lot more use of < > and a much higher mixture of variables/functions/parenthesis plus the added bonus of trying to remember a single function from a choice of 3000+.

My typing style has definitely adapted over the years to cope with different languages. I certainly feel that my typing speed is an advantage when my brain is fully engaged and allows quick construction while inspiration keeps coming. On the other hand if I am solving something complex and more time is going into design and structure then typing is not the bottleneck.

What does everyone else think? Are you a one fingered typist? Does it hold you back? Would you hire someone based upon their typing speed?

There Are 48 Responses So Far. »

  1. I tend to type with most of my fingers, but mainly index, middle and little. Not really sure how that evolved, but I’m fairly sure the involvement of my little fingers is due to the number of brackets I type.

    I don’t think I’d hire someone based upon their typing speed, but it definitely has an impact on productivity. The faster you can type the code the quicker you can get what’s in your head into the machine. I really hate it when Zend Studio or Visual Studio decides it need to do something while I’m typing, and I end up waiting for it to catch up with me.

    My question would be… do people find context-sensitive popups help or hinder? Personally I’ve never gotten used to the ways of getting rid of them - hitting escape mid-stream distracts my fingers. That’s why I have the delay in both IDEs set to 5 seconds. That way if I need it I just need to pause, which is fine because by then my flow has already been broken. It used to particularly annoy me with HTML in Zend Studio.

  2. Like almost every 18/24 heavy-duty PHP programmer I do touch type. In a hurry, you might tend to use backspace key, slightly more often ;)

    However, I noticed something else in the PHP code snippet. If it actually is the beginning of the script, I would suggest using require_once(), when you want to include the code unconditionally. There’s no way the code is not going to be included, so I suppose require_once() would be better and maybe safer in this case. Do you agree?

    Good night.

  3. I guess this is just a random piece of code showing how the syntax looks like.
    But, A) there is a way the code will not be included, the file might be missing or not accessible.
    B) the only difference between include and require is how they behave on failure, include will throw a warning, require will end the script with fatal error. You usually don’t want to continue if part of your application is missing, so there’s rarely any use for include statements.

  4. According to me I feel Touch Typing is a must for a good programmer and a good programmer touch types. I hate to see programmers using just couple of their fingers to type.

  5. PHP has introduced another set of typing problems with a lot more use of

    you can throw out these, ‘case good programming means separating content from logic and design .P

  6. First of all, my apologies for my English, as I am Spanish ;)

    I think typing fast isn’t what really makes a programmer to be ‘good’. What makes the difference is the ability to think good solutions (robust, efficient, etc) and to be able to create good applications out of it. Fast typing is something that comes with time, with practice, but only if you bother typing correctly, using every finger in the right position. So, more practice will mean more experience always, but only a faster typing if you really bother.

  7. I have updated the PHP code snippet to something I have written. Why? because the original was something I just grabbed off the internet late last night at home as I did not have access to my own code. So feel free to analyse it now :) plus it is now more indicative of the type of code I have to type (within a view)

    Makken, It is a given that bad programmers typing fast are still going to produce bad code (just more of it.)

    Stuart, code completion is for me, either too slow, or if it pops up fast annoying because it never gets it right. Showing me parameters for a function is the only feature I really like.

    I type using a Natural keyboard so I have no option but to type correctly, this took a while to stop myself using my right hand to type ‘T’.

  8. My problem is that I started with wrong typing style, so it is really difficult to adapt proper touch typing. Other problem is that in other than programming tasks (sometimes even in those) I use another keyboard layout for my mother language which includes a fairly large amount of letters (~double as much as english). So I need to switch layouts often, this also means mental switching and these are not always in sync. As a result I don’t type as quick as I would like to, but I think it’s still much faster than ‘regular users’. :)

  9. Nick, try using alternative syntax for conditional statements like switch: endswitch; when you mix it with html in your views. It will make it more readable.

  10. Karol: Using the word equivalents to replace brackets may make it more readable for you, but it’s a personal preference. Personally I prefer brackets because I came from a C++ background and I find the text versions (if, endif, switch, endswitch, etc) to be verbose and over-complicated. But that’s just my opinion.

  11. Karol, that’s not the only difference between include_once() and require_once(). The main reason is that include_once() includes the file in the runtime and require_once() includes the file in the pre-analysis of the code, right before the interpreter goes through the code line by line.

    Therefore, when you use require_once() conditionally, the code will be included no matter, if it is actually necessary, or not. That’s the difference (quoting Dr. Dre) ;)

    Nick, your code is very good. Good work ;)

  12. I like simple things like brackets (or rather braces in this case) too. But they get lost in mixture of html and php. It’s hard to tell when the statements ends. So I don’t agree that it’s just ma matter of personal preference in this case, they made it to the language for a reason. Of course I would never suggest using them in php-only code.

  13. Przemek: Since early php4 version, around 4.03 require and include behaves just like I said. I don’t know this Dr. Dre but you can point me to a page I manual or smth to back up your claim. I’m always happy to learn something new.

  14. Przemek: The only difference between include and require is the type of error raised if the file cannot be found. Both get processed at compile-time not runtime. Also it’s recommended not to use the _once variations if you can avoid it because you incur the cost of the lookup.

    Karol: Just because your preference is one of the options, doesn’t mean it’s not a matter of personal preference. Your opinion is not necessarily the correct opinion. Learn to accept there are points of view other than your own that are equally valid.

  15. Stuart, I’m entitled to my own opinion and I can disagree with whatever you say. You can put your arguments on the table and participate or not. There’s no need to get arrogant and personal again just because you didn’t like my opinion about your job in judging the competition.

  16. Stuart, I’ve never before seen anyone recommending not to use _once, can you elaborate on ‘the cost of the lookup’? This is the most common technique for loading library files, I’m very interested to know what is wrong with it.

  17. [...] Link to Article c# Do faster typists make better coders? » Posted at The Programming and [...]

  18. Agreed, what is the cost difference with _once and not _once? obviously you should only use it if you have the possibility of including the same file twice. Would be interesting to understand the internals, does it hit the io? use a table in memory?

  19. Hm, I just realised that this particular switch statement does not overlap with html, so my comment was bit irrelevant here. I rushed a bit trying to find something to improve in your code Nick, maybe next time :)

  20. Karol: When did I get arrogant? I’m open to other peoples opinions, but it seems you’re not - that’s the point I was trying to make. As far as I can tell I am participating in a non-confrontational way - if I’m not I’m happy to accept criticism when it’s justified.

    The point of the _once variations of require and include is to prevent multiple inclusions of the same file. In order to do that PHP needs to lookup whether the file being included has been included already. That costs time. A while back Rasmus had this discussion on his website where he justified why he doesn’t use the _once versions: http://toys.lerdorf.com/archives/34-Flickr-API-Fun.html#c3016.

  21. Paul, it has to check if the file was already loaded. It may add some overhead, but the performance hit is probably non existent. Developer cycles are much more expensive then hardware cycles and premature optimization is the root of all evil. require_once allows you to easily load library files and there’s no good reason not to use it in my opinion. And it’s a common (and good) practice anyway.

  22. Stuart, ok, can we agree to limit any personal comments and stick to the subject?

    Rasmus is known for his controversial opinions, often he’s got a valid point, but this is a man that lives in procedural C and cares more about optimization then code maintenance and real life scenarios.
    In my opinion going to such lengths as reorganizing your include statements is only valid in cases of extreme optimizations when you ran a site like Yahoo. Still an effort like that can be completely wasted by a single not optimized sql query etc.

  23. Karol, Im aware of what it does, just not sure how it does it. I assume (assume!) that all the include/require functions make a note of what files have been loaded, then if a _once function is called, it checks in memory if it has, if not then it loads it. Can’t see how this is slower than hitting the filesystem? (reading the post it checks the internal hash)

    I don’t really agree with Rasmus, nobody on there really does.

    Any C programmers out there never used #ifdef ??? His arguments are weak in that respect.

  24. Paul, that’s typical for Rasums he lives in a different world :)
    Anyway things like that tend to get optimized on a language level, it only makes sense to care about it in extreme cases. Like using opcode caching, if you organize all includes in a specific way you can gain additional performance from class cache.
    But the performance gain will be next to nothing compared the the hit you incur on badly design model, inefficient queries or lack of data and output caching.

  25. Karol: I don’t believe I’ve said anything personal in the comments on this post. If I have I apologise.

    Premature optimisation? This is the sort of optimisation you have to do from day one otherwise it will become a nightmare to change.

    I agree that for a small site with a small number of included files the performance hit will be negligible, but I tend to work with sites where the number of files run into several hundred per page request. When you start getting to those quantities the performance hit starts to add up quickly.

    In addition to that I consider using the _once variations bad practice because it implies that the developer is unaware of which files are getting included where which can only lead to problems as a site grows, in both performance and maintainability. In my opinion the capability _once gives encourages lazy programming.

    I agree that Rasmus occasionally gets it wrong - we all do. However, your description of him shows that you know very little about him. If you feel you need to attack me personally because you think you got a raw deal in the competition, go ahead, but please don’t take it out on others.

    Rasmus posts some test results on that site where he concludes “the require_once is always 55 to 75 requests per second slower than a straight require”. Yes it’s a test, yes the effect will be magnified, and yes a poorly optimised SQL query will still cause bigger problems, but a performance gain is still a performance gain.

  26. Is that test even valid? You would never use include_once once, which is what the test is doing, it’s obvious in that test _once will be slower. The whole point of the _once functions is where there is a possibility the file has been included multiple times in one script.

    What about external libraries using common files, which you have no control over? Surely _once makes sense in that respect? If you have complete control over each and every file then sure, you should know what your app is doing, but is this the case in the real world?

  27. Stuart, Fist of all without comparison benchmarks in real life application between one method and another, there’s no way to tell what the impact is. If you have them, please share the results. Then, even if the hit would be noticeable what’s worth more attention, include statements then other stuff (caching, sql, etc)?
    I also don’t agree that a developer should track which files have to be included. It’s imho unrealistic on large sites and developers have better things to do than that.
    It’s also unnecessary burden if you ask them to do that from the start, it’s just like any other premature optimization, it’s evil. I personally rely on __autoload(), because I feel my time is better spent on actual programming than managing includes. And why would I need to know which files are included when?

    Offtopic: I know enough abut Rasmus, some of it first hand.
    As for the competition, let’s put it behind already. You are clearly biased towards me here, I believe you are trying to prove something, but I don’t have time for this. Let’s stick to the subject and subject only.

  28. Paul: The test is comparing the raw speed of include against include_once, not the speed of including the same file several times with them. Like I said (as did Rasmus) this will magnify any performance hit, but it shows that there is a potentially significant improvement to be had. It should be obvious that using _once when you know you’ll be including the same file multiple times is going to improve performance, but in that case you really should be asking whether you’re structuring your code in the most efficient way.

    I agree that if you’re using external libraries it will be safer to use the _once variations, but that shouldn’t stop you making the improvement to the code you write.

    The “real world” varies for everyone. In my “real world” I rarely use third party code but I know a lot of developers who do and I can see why. I prefer to know what my code is doing.

  29. Karol: I’m not biased against you, if anyone else had made similar comments my responses would have been the same. I’m sorry you feel that it’s personal. I can assure you it’s not.

    I think it’s best that we agree to disagree on this one. You have your opinions and I have mine - there is clearly very little common ground and we could go around in circles forever. You write your code the way you want to and I’ll write mine the way I want to.

  30. I am aware the test is comparing raw speed, as I said before, include/require would obviously be faster - it has no checks to make. I think we all agree on that.

    You are very lucky that you manage your own code (it seems) but in my “real world” there are thousands of files that I would need to keep track of, not written by myself, some in PHP4, some in 5, you get the picture.

    I know what my code does, but sometimes it is beyond my resources to take the time to figure the internals of others.

    This is starting to get pedantic, kudos to you for being in the position you are in, but there are benefits to using _once in circumstances other than your own.

  31. Stuart:

    Using third-party code doesn’t suggest that one doesn’t know what his code’s doing. I wouldn’t use third-party code unless I knew exactly what it did.

    Nor does _once encourage bad coding any more than condoms encourage promiscuity. There are any number of reasons to use _once in code — libraries, dynamic inclusion, and yes, even mistakes, which you yourself said we all make from time to time. It’s important to do things the right way, and it’s important that everything doesn’t fall apart when we don’t. These two ideas aren’t incompatible with one another.

    I use require_once for those reasons, and also so that when I or someone else has to come back to my code and do something quick ‘n dirty — and in my real world, that happens — it can be done without breaking anything.

    I’m kind of curious as to whether the speed saving (of not using _once) is comparable with use of ” over “”, only because I saw some folks ripping each other’s necks apart over the latter controversy not too long ago. Deja vu.

    Me, I type at a moderately fast pace, though any secretary would leave me in the dust. It seems to make sense that if you’ve coded long enough, you just end up typing faster. (All other things being equal.)

    But _once is a far more interesting subject. =)

  32. We are talking about the performance here, do (or find) a benchmark of a decent size application running on a modern hardware. If you get any real performance increase, let me know, I’ll be really, I mean really impressed. Without the benchmarks, the claim about inefficiency of _once has no grounds and it’s just spreading FUD in my opinion.

  33. I would at this point say ’stick to the subject? but you’re all obviously having far too much fun.

  34. I learnt to touch type before I learnt programming. Having the skill sure did make me a faster coder, and that’s the way I like it. I love watching code appear on the screen in front of my eyes as I type. It gives me a pleasure. A one finger typist does not have that pleasure because they are too busy looking at the keyboard. Even the mouse is a deterrent. I personally have no patience for slow coders. After about 3 seconds of watching them code, I kick them out of their seats and do it myself.

    Would I hire a one finger typist?
    No.

    Do faster typists make better coders?
    No, but it does make them the best that they can be.

  35. This seems to miss the point. Typing speed is great when you need to change code, it makes you less afraid of doing so. However, if your code is so verbose that you need a high typing speed to be able to write it in the first place, you might want to think about why. Is it that your poor skills make you write too much code, or that your poor language/environment does?

    There are languages that promote short code, and code written in those languages is usually more readable than verbose code.

  36. There’s a thin line between verbosity and obscurity in the code. I always try to keep the code short, less to type, less to read, easier to understand. But that’s not always true, sometimes I look at my own code and think - I was too smart for my own good.

    I would personally not care about someone’s typing speed while hiring. But it’s a bit silly for an IT professional not being able to type quickly. Someone like that probably didn’t spend a lot of time coding and will not be qualified enough to pass the interview anyway.

  37. I would say that it does in the same way that being a fast-talker makes you a good communicator (in other words, no).

  38. Dude, you evolved from assembler to C to PHP? That’s backwards, at least from a performance standpoint. From a learning-curve standpoint, too.

    Anyway, no, I don’t care about how fast someone types, but I do care about how hot she is. I mean, if she’s hot enough, she ain’t gonna spend all that much time typing anyway, you know what I mean?

    Otherwise, I don’t like to watch programmers program. You ever watch FoodTV and notice how chefs watch other chefs? It’s always as if they want to take the knife out of the other chef’s hands and do everything themselves. That’s how I feel about programming. I’m always like, “Ah, God, he’s typing with that dorkassed one-finger-Louie style”, and “Oh, FUCK, he’s writing two one-line FOR loops instead of one two-line loop in order to keep their logical functionality separate, because he’s FUCKIN’ ANAL” and when you ask the guy about that idiosyncratic foible nonsense he’s spouts some hair-twirling, gum-popping answer about how he read that’s what you should do in “Code Complete” or something. Fuck. FUCK. I’d like to take that copy of “Code Complete” and beat the living shit out of him and his fucking kids, too, for having had the unfortunate disadvantage of inheriting their father’s genes.

    So, no, typing speed doesn’t bug me. It’s mostly other coders’ code that bugs me. But not all the time, because I have worked with some brilliant people, who even typed slowly, but whose code was excellent. That doesn’t happen often enough.

    So my advice is this: hire hot chicks and you won’t care about how fast they type, and then don’t worry about how fast other programmers type if they’re typing quality shit.

  39. I was immediately drawn to this article by its title :) I’d like to think of myself as a pretty good coder but my typing really sucks!! I definitely feel that it would be a lot more enjoyable for me to code if typed a faster but I don’t necessarily think that it affects my productivity. I work primarily in Java and fortunately IDE’s like IDEA and Eclipse make it less of a problem with code assist features like autocomplete. And what is a true measure of productivity? Number of lines of code typed in a day or better designed / written code that has fewer bugs. Consider the time / cost it takes to go back and redo the code written by some developer with fast typing skills. Sometimes slow and steady wins the race. And considering that statistically developers don’t write more than 100 lines of code per day on an average I don’t think that typing speed is directly related to developer productivity. It can be argued that someone who as been doing a lot of coding has developed good typing skills, but unfortunately that didn’t happen in my case

    But I hate watching all you fast typing developers!!! :)

  40. [...] Halstead asks an interesting question on his blog today - “Do faster typists make better [...]

  41. The fingers that seemed the hardest to train back when I was learning to type in highschool were the smaller fingers.

    The torture of working only your pinkies if you stuck through typing lessons actually were the save-all for coding.

    The pinkies are given the seemingly obscure characters that we coders use more than others. Not only was learning to type well with all my fingers including my pinkies was not to slack when learning to type symbols and numbers at the top of they keyboard.

    Knowing how to touch type things like parenthesis, symbols and numbers are the bonus of knowing how to touch type well in coding.

  42. I work with a lot of older programmers who still finger type, no disrespect, but other people judge them as a whole on how fast they type. When I’m not typing fast code (VB.net, mysql) or other docs at the office , people here assume I dont have enough tasks to do. So theres a word of warning - use quite keyboards too!

  43. I do think touch typing is essential for a day to day programmer. I really get frustrated when my coworkers type looking at the keyboard and make mistakes and don’t look up until the end of the row only to find out they have to correct 4 mistakes. Which they probably wouldn’t notice until the parser throws a few errors.

    I’ve been touch typing ever since we got taught in 5th grade. And it has saved me a bunch of time over the course of my geek computer savvy lifestyle.

    If you want to somewhat improve your typing speed and accuracy with a fun twist to it I suggest you try out Qwerty Warriors 2

  44. I’m glad that touch screens for the PC never took off! Softkeyboards are hard on the thumb. Too much poking :)

  45. JMC: “I would say that it does in the same way that being a fast-talker makes you a good communicator (in other words, no).�

    Touchtyper is a normal-speed-talker. One finger typist is someone with a speech impediment.

    Typing speed varies over a broader range than speech speed. According to Wikipedia, speech is usually between 150 and 200 wpm, giving a ratio of 1.33. Range of typing speed varies from 23 wpm for slow typist up to 70 wpm for fast touchtypists. Let’s assume that programmers aren’t that slow. I would assume that the best you can get without touchtyping is 40 wpm. That would give a ratio of 1.75 (and 3.0 when considering slow typists).

    Normal speech speeds just don’t vary enough to sustain the analogy to typing. You need to introduce speech impediment to make this analogy fair.

  46. There are too many factors to take in to account, typing speed is just one. What about a slow typist who plans out his design before coding compared to fast typist who just jumps in, constantly re-factoring their code?

    If both can bring in a project on or before time there’s very little difference.

    Typing is an attribute which should be seen as part of the bigger picture.

  47. Ass And Tities Porn…

    Ass And Tities Porn…

  48. girls fighting naked…

    girls fighting naked…

Post a Response