back

by thunderbong·9y ago·view on hn ↗
Typing.

By far the most under-rated and the most useful skill to have as a programmer.

When I seriously started programming, I spent one hour every day for 30 days on typing using one of those many typing softwares.

The first thing I noticed was how much less thinking I was doing with regard to my typing. I didn't have a part of my brain guiding my fingers any more - the fingers already knew. The other thing I noticed was that I wasn't typing by characters, I was typing by word.

With these two things I was already able to write programs faster.

But the other things I've noticed have happened so slowly that I almost didn't realize it. While typing, I can see a broader swathe of the program on the screen than I used to. Code smells popup in my head way sooner. While typing logic patterns that are common, my brain seems to be able to think across the entire program better rather than get caught up in the current file and program flow. All this probably because the brain doesn't need to constantly flit around telling me what key to press.

Because of all this, I tend to use keyboard shortcuts everywhere. Whenever I start using a new program regularly, I either memorize or create keyboard shortcuts.

Now, when people give me credit for being fast or more productive or knowing a language better, I think probably all of those things, even if true, would surely have taken longer if I didn't know typing.

I tell this to every beginning programmer. But sadly, till date, I've not seen anyone dedicate the time to learn this one skill that would help them in their careers, in their knowledge, in their life, in so many ways.

4 comments
"Next dead-giveaway: non-typist code is... minimalist. They don't go the extra mile to comment things. If their typing skills are really bad, they may opt to comment the code in a second, optional pass."

Steve Yegge in http://steve-yegge.blogspot.com/2008/09/programmings-dirties... where he also says

"And as for this non-college bullshit I got two words for that: learn to [explitive] type" — Mr. Pink

And from Coding Horror (Stack Overflow co-founder):

We Are Typists First, Programmers Second https://blog.codinghorror.com/we-are-typists-first-programme...

>"Next dead-giveaway: non-typist code is... minimalist. They don't go the extra mile to comment things.

Is this why it seems that programmers never write comments these days? I feel like I'm the only one who uses a healthy amount of comments. But I'm also a very fast typist; I've been typing since I was 7 I think, and I can type fast both on QWERTY and Dvorak, and even switch seamlessly between the two layouts (I'm typing this comment in Dvorak). One of these days I want to try out Colemak to see how that compares; it'll probably be really easy for me to adopt it. So typing comments to me is very low-effort.

There are certainly other reasons. For example, I only comment as an admission of failure to express my self in code. Most of the time a better variable name or adding a function with a descriptive name will say the same thing as a comment
The comments that matter are the WHY comments. No amount of variable naming will solve that.

When I read your code three years from now, I can still figure out what it does. WHY you're doing the things you do is a different question. And few people leave them. Add them, and you're standing already heads and shoulders above your peers.

Every programmer I've worked with can type just fine. I think the reason we don't comment code is because we believe the meaning of the code is self-evident via names, conventions, and structure. I am happy to comment code when I think the "why" is unclear without having the whole project in one's head, but I'm often amazed later on how much I guessed wrong and failed to comment something that needed elaboration. When I fix bugs, I almost always end up adding comments and request the same in code reviews.
If you already know Dvorak I'd personally recommend Workman as a third as someone who was in the same position of already being competent with QWERTY and Dvorak.
I went and tried out both Workman and Colemak for a few minutes; I'll have to give Workman more time to try it out, but one thing I noticed about Workman and Colemak, and of course Qwerty, is that they all have the most-used punctuation at the bottom of the right hand. This is actually one thing I prefer about Dvorak: the punctuation symbols (period, comma, quote mark) are in the upper left-hand area, where it's a little easier to get to than anything on the bottom row. I use periods and commas a lot, which I think isn't unusual, so I always thought it was weird that other layouts relegate these to the 2nd-hardest to reach part of the keyboard (for a right-handed person).

What are your thoughts on Dvorak vs. these other layouts?

Personally, my biggest gripe with Dvorak is that it bunches up all the vowels on the left hand home row, and it puts A on the left pinky, while U is on the index finger and I requires a lateral stretch. I do like how Workman sticks the E on the strongest finger, the right-hand middle finger. But the punctuation bothers me, and I feel like both it and Colemak make some sacrifices in the interest of not deviating too far from familiar-old Qwerty. As someone who's already proficient with Dvorak, I really don't care if a layout is "alien" to Qwerty users.

Very interesting, thanks for the tip!
Do people honestly not know how to type by the time they become programmers?

I've used a computer since I was 5 years old. I can type without looking. (I'm sloppy as hell though, since I was self-taught.)

But everyone I know types without looking.

This is precisely why, to this day, I hate all laptop keyboards... the feel, and spacing is just so different, it's hard to get used to. I'm typing this on a Unicomp 103-key modem-m style keyboard... spacing is closer to original vs 104-key. Can't express how much better it feels.

At work, I'm using a mechanical keyboard with Cherry MX blue switches, to be (slightly) less annoying, but it's still a very different feel to it. These days, my only pain points are that getting natural scrolling outside of a mac is difficult (windows wants to keep resetting it back) and ubuntu removed it from the options, and it doesn't always work. And the ctrl/cmd characters on mac feel wierd... I've got cmd in lower-left and cmd at alt position, but in a console it's of course backwards in terms of muscle memory. And in mac home/end don't work as expected.

Not sure where I carried off into a hardware rant... but all the same, what you touch and look at are surprisingly important.

I've used a computer since I was about 5 too, and I learned how to type after I got my first job as a programmer. We're out there!
> But sadly, till date, I've not seen anyone dedicate the time to learn this one skill that would help them in their careers

The first person that tells them is a curiosity, the second a fluke, and the third is on to something. If you're always the first person to tell them, you'll never see them heed your advice.

Hmm. When coding in Assembly, typing skill does not seem to matter. Why, then, should it matter when coding in other languages?

Also, whenever I watch a programmer use their typing skill, I can't help noticing that they use the backspace key almost as often as all other keys put together.

Oh, and one more thing: one of the best and extremely productive programmers I have known suffered from cerebral palsy. You can imagine that his typing skills were not very high.