Is Dvorak typing appropriate for programming? [closed]
Asked Answered
R

12

125

I'm always looking for ways to be more productive, and I've been reading a lot about typing using a Dvorak keyboard.

It looks like this would be much more productive for writing normal prose, but what about for programming?

I'm skeptical that it would be effective, since the use of semicolons, colons, brackets, and ampersands are much more common in programming than they are in every day typing.

Has anyone had any experience with this?

Return answered 3/8, 2009 at 12:37 Comment(10)
typing is still typing. anything that makes you faster is a godsend. however, unfamiliarity with dvorak makes any specialized answer to your question by me uneducated.Balladmonger
I like to pair program...I hope that the OS has a hotkey that'll toggle between QWERTY and Dvorak.Basketball
The time spent learning Dvorak to an efficient level would probably be better spent on productivity...Corollary: The time spent on SO...Amy
@T Reddy: Windows will automatically(?) set up an alt-shift-number(?) key combo to switch between keyboard layouts. @Evan: It took me about 2-3 weeks of typing at my dorm to learn Dvorak at a speed comparable to qwerty.Booze
@Amy I disagree. If I learn Dvorak at home, its not like I could use that time to be more productive.Return
There is a good autohotkey script for switching into dvorak layout but keeping old hotkeys: autohotkey.com/forum/topic27474.html (Windows)Adalia
Closed as not a constructive question? But ergonomics is very important! Where are we supposed to ask these types of questions?Monacid
@samoz: it surprises me that someone would not deem his private time (i.e. at home) productive. I'm usually as productive at home as at work, mostly just doing other stuff (but many times involving keyboards, be it with or without ivory keys)Primrose
Currently I am quite satisfied with the CPM I reach with QWERTY. The only reason for me that I am considering Dvorak is to reduce strain (RSI) and have more comfort. But before switching from QWERTY to Dvorak, I strongly advise an ergonomic keyboard, if you haven't got one already.Tisbe
@TimReddy you can switch between layouts easity. On Windows you can switch between layouts with Ctrl+Shift by default, and languages with Alt+ShiftRankle
E
54

There are Dvorak layouts specifically for programming: http://www.kaufmann.no/roland/dvorak/

Expander answered 3/8, 2009 at 12:49 Comment(12)
This is kind of cool. I like it.Hillside
Dvorak already has the huge con that the rest of the world uses qwerty, now if we start using modifications of dvorak too.. It's even worse! :)Pulmonary
@AndreasBonini: by the same token, you could say that, since users of the dvorak keyboard layout have proven themselves to be flexible enough to adopt another layout, they can probably just as easily manage adapting to a personally tuned one - and to great effect? (just playing devil's advocate here)Primrose
@AndreasBonini , but QWERTY keyboards already have different punctuation keys in different countries. They are in different locations, they are different (US keyboard has no ´¨ç etc), and sometimes they even work differently! (In US keyboard there are no dead keys AFAIK, so one gets ~n instead of ñ, ^o instead of ô...)Format
I've been using Programmer Dvorak for 2 years, and I'm really happy with it. Changing muscle memory for shortcuts is hard, but not that hard. I have even created a typing tutorial for Programmer Dvorak: programmer-dvorak.appspot.comKeary
Is there any proof that this is actually more efficient when tested on lines of code (ie C,C#, javascript, perl, etc..)Tenebrae
I've been using it for quite a while for now, maybe a year or so and ([{}]) are very comfortable, but I still can't get used to the numbers if I don't have stickers on the keyboard. Another con is that you have to install this modified layout on any system you use.Effusion
The kaufmann.co layout is programmer dvorak from linux, with the author's own modifications I cannot stand. You can make your own layout matching linux's using a windows utility.Leung
@AndrewSmart it seems to me to be the other way around: programmer dvorak from linux is a modification of kaufmann's layout (or maybe just an older version?). But I also can't stand the numpad inversion: because it's "common on phones" simply isn't good enough reason for me. Luckily, debian's layout doesn't have this modification.Ammunition
@SameerAlibhai The research doesn't seem to have been shared, but there was one: It was generated through reflection of the most common constructs in these languages and the rules set forward by the August Dvorak in his research, then verified by scanning through thousands of source code lines ensuring that a good fit was found. (from kaufmann.no/roland/dvorak)Ammunition
@AndrewSmart They are the same; I made them both. The Xkb (Linux) version is modular, though, you can choose whether you want the numpad or not. The keyboard layout architectures on Windows and macOS don't allow that.Im
@Im They are not the same in my user experience. It must be a bug in the MS Windows executable published on your website then. On Windows 7 when using that programmer dvorak layout the q key was mapped to " (double quote), and the z key to ; (semicolon). There were many more differences, I had to make my own which matched the one on Linux. I love the one on Linux, tyvm if you indeed made it!Leung
B
97

A couple years back when I was starting to feel some pain in my wrists, I decided to learn how to type on a Dvorak layout. (Side note: I found it extremely simple to learn the layout using a qwerty keyboard while looking at an image of a Dvorak keyboard at the bottom of my screen)

The only programming difference primarily was that the square brackets and curly braces swapped positions with the minus and plus buttons above them. Depending on what language you're using and how heavily you're using those keys, that can be annoying; but then again, maybe your IDE will automatically insert those where appropriate. Or, you could use a program like AutoHotkey to map another key combination to those symbols.

Here's the thing with typing in Dvorak: (IMHO) you need to go all Dvorak or all qwerty, particularly if you heavily rely on keyboard shortcuts throughout all of your computing sessions.

My situation is that I use Vim very frequently both at work and at home. At my last job, computers were shared between multiple idiots people, and I could not reasonably expect other users to know how to switch out of Dvorak. I had to "re-learn" the muscle memory for Vim commands.

It's extremely easy for me to switch back and forth on the fly between qwerty and Dvorak for simple text, but (and maybe it's just me) all my known keyboard shortcuts are muscle memory. So a :w in Vim on qwerty ends up as a S,, and a I# to comment a line ends up as C#, instead of replacing the whole line with just a pound symbol. And you can just forget about hjkl to navigate in Vim - instead of pressing keys on the home row, now you have to press the equivalent of jcvp. Oh, you want to copy-cut-paste with one hand? xcv has now moved to bi. instead, so have fun reaching all over the keyboard. New tab in Firefox? You were just typing in Dvorak, so you hit ctrl-t, but the keyboard is actually in qwerty mode, so you just ctrl-k to jump to the web search bar.

One of the other low points of Dvorak is the awkward 30-60 second explanation if a coworker needs to use your computer for a moment.

So I'm very sad to say that after about 4 years of typing primarily in Dvorak, I have to type in qwerty now because it is simply unnecessarily difficult to switch back and forth between modes and retain my muscle memory of my keyboard shortcuts.

On the other hand, there is some Vim work-around support for Dvorak, so maybe today would be a good day for me to get back on the Dvorak wagon. And I suppose if somebody were feeling particularly ambitious, he could set up an AHK script to remap normal/shifted keys from qwerty to Dvorak, but just pass through the qwerty keys when ctrl/alt were held. Seems like it would be a lot of work for very little payoff, though.

To recap:

  • Dvorak is great for RSI
  • Switching between qwerty and Dvorak is easy for typing, horrible for keyboard shortcuts and other muscle memory
  • Dvorak can be a large hassle to use at work, depending on your work environment

I sincerely hope this gives you some more direction on the decision of whether to go Dvorak.

Booze answered 3/8, 2009 at 16:58 Comment(10)
definitely write down and test passwords before switching if you are relying on the muscle memory to type them.Unilateral
I use dvorak and have been for years. Would not go back to Qwerty for nothing. It's painful to use Qwerty on other peoples VMs. Yuk!Demantoid
Thanks for a very helpful post. I could relate to what you were saying, even though I have never tried dvorak yet, and the amount of detail shows that you've really given this thought. On the other hand, without dvorak, I already have these awkward 30-60 second explanation moments while I switch Visual Studio out of ViEmu mode... :)Primrose
When it comes to shortcuts, Mac supports Dvorak with QWERTY shortcuts. So I use QUERTY shortcuts in Dvorak. The only advantage for QWERTY is that c and v are in better locations :)Joappa
This will let you use dvorak in insert mode and qwerty in normal mode so you don't have to relearn anything. However, it doesn't work for ex commands or searches.Voiceless
I switched to Emacs with Evil and now have a flawless Vim + Dvorak experience. How to do that is off-topic here, but you can email me or ask a separate question if you're curious.Voiceless
+1 it can be a large hassle to use at work. Especially at shared workstations, or trying to demostrate something on a peer's computer. Windows has terrible support for it: -Every window can have its own keyboard layout setting! A nightmare when ever allowing more than one layout on the system settings.Leung
-The Windows login screen layout can be a nightmare for typing passwords. With lengthy difficult passwords, you have no idea what the layout is currently (no visual feedback), no way to easily determine the layout, and at my last work the system locked you out for an hour if you mistype the password a few times. Huge issue! Countless times off hours I'd get locked out.Leung
-Windows does not include programmer dvorak like linux does; the programmer dvorak layout readily available by kaufmann.co has his own weird tweaks that I cannot stand (all numbers and symbols are moved around). So I had to make my own to match linux's and even then there are annoying unfixable little differences between the layouts such as caps lock.Leung
Thank you for sharing this.. It feels like it's a nightmare for vim users.. I'll stick with querty i guess..Ichabod
P
87

Believe it or not the amount of special characters (such as [], {}, etc) in source code is negligible compared to normal english text.

I wrote a small program that counted the occurrences of every character in the source code of a fairly big project I'm working on (50k lines), these are the results. The language is C++.

    E = 104050
    T = 86887
    I = 62788
    A = 61746
    R = 60438
    S = 58897
    N = 56595
    O = 51640
    L = 45490
    C = 39251
    D = 33776
    U = 30971
    " = 27858
    M = 25925
    , = 25296
    P = 23742
    ( = 21407
    ) = 21391
    F = 21232
    G = 20860
    / = 19745
    H = 19717
    ; = 19226
    _ = 16207
    B = 13576
    = = 12427
    Y = 10498
    0 = 10125
    . = 9842
    K = 9241
    : = 8907
    W = 8509
    V = 7922
    { = 7648
    } = 7639
     = 6626
    % = 6507
    Q = 5896
    1 = 5752
    - = 5382
    X = 5261
    ' = 3877
    \ = 3421
    2 = 3395
    + = 3172
    & = 2702
    [ = 2597
    ] = 2586
    3 = 2174
    Z = 2141
    4 = 1657
    J = 1599
    ! = 1595
    5 = 1560
    # = 1501
    6 = 1367
    | = 1029
    8 = 967
    9 = 953
    7 = 939
    ? = 610
    ` = 367
    ~ = 59
    $ = 47
    @ = 7
    ^ = 6
Pulmonary answered 2/10, 2009 at 3:50 Comment(14)
strange numbers for all the braces and brackets... Nevertheless those are as hard to reach on both on qwerty and dvorak. Hardest thing for me on the dvorak is typing 'qwerty'.Ensheathe
( = 21407 ) = 21391 { = 7648 } = 7639 [ = 2597 ] = 2586 Why don't those match?Pinkham
@LeoJweda comments can distort it.Compatriot
@Compatriot Unless he's using smilies in his comments they should still match.Pinkham
@LeoJweda haha! I mean it's not necessarily required to match in comments. I'm sure every code will poorly formatted comments.Compatriot
@LeoJweda I strongly suspect things like commented-out function declarations.Martainn
@LeoJweda: 99.92% are matched.. If the code base is large enough, it's normal that for one reason or another a small minority don't. Hopefully it's not because of smiles, since :( would be much more common than :) in that case :PPulmonary
I'm late to this, but this is assuming that you type out every single character. In practice, I'm often autocompleting and instead of typing out, for example, FooBar.SomeProperty, it would just be fb.sp, which greatly skews the ratio of keystrokes for alphabetical to non-alphabetical.Importunity
Less than 6 * in big C++ code? No multiplications or dereference operators? Sounds weird.Ammunition
@GabrielF: I removed it from the list because it was too high as I use a lot /********/ as a separator. See stackoverflow.com/posts/1507668/revisionsPulmonary
Measuring key strokes may be more accurate as modern IDEs generally offer intellisense / autocompleteSpinelli
@AndreasBonini but instead of :( it can be (:!Loggins
@ThomasBonini You could write a script to scan for unmatched { ( [ and see what's going on. Just count up the { ( [ in each file and find the files with a mismatch.Proselytize
@LeoJweda Maybe someone though of creating a code block or a conditional test but later on changed his mind. That's why you see the opening braces appearing more often than the closing braces.Hippopotamus
E
54

There are Dvorak layouts specifically for programming: http://www.kaufmann.no/roland/dvorak/

Expander answered 3/8, 2009 at 12:49 Comment(12)
This is kind of cool. I like it.Hillside
Dvorak already has the huge con that the rest of the world uses qwerty, now if we start using modifications of dvorak too.. It's even worse! :)Pulmonary
@AndreasBonini: by the same token, you could say that, since users of the dvorak keyboard layout have proven themselves to be flexible enough to adopt another layout, they can probably just as easily manage adapting to a personally tuned one - and to great effect? (just playing devil's advocate here)Primrose
@AndreasBonini , but QWERTY keyboards already have different punctuation keys in different countries. They are in different locations, they are different (US keyboard has no ´¨ç etc), and sometimes they even work differently! (In US keyboard there are no dead keys AFAIK, so one gets ~n instead of ñ, ^o instead of ô...)Format
I've been using Programmer Dvorak for 2 years, and I'm really happy with it. Changing muscle memory for shortcuts is hard, but not that hard. I have even created a typing tutorial for Programmer Dvorak: programmer-dvorak.appspot.comKeary
Is there any proof that this is actually more efficient when tested on lines of code (ie C,C#, javascript, perl, etc..)Tenebrae
I've been using it for quite a while for now, maybe a year or so and ([{}]) are very comfortable, but I still can't get used to the numbers if I don't have stickers on the keyboard. Another con is that you have to install this modified layout on any system you use.Effusion
The kaufmann.co layout is programmer dvorak from linux, with the author's own modifications I cannot stand. You can make your own layout matching linux's using a windows utility.Leung
@AndrewSmart it seems to me to be the other way around: programmer dvorak from linux is a modification of kaufmann's layout (or maybe just an older version?). But I also can't stand the numpad inversion: because it's "common on phones" simply isn't good enough reason for me. Luckily, debian's layout doesn't have this modification.Ammunition
@SameerAlibhai The research doesn't seem to have been shared, but there was one: It was generated through reflection of the most common constructs in these languages and the rules set forward by the August Dvorak in his research, then verified by scanning through thousands of source code lines ensuring that a good fit was found. (from kaufmann.no/roland/dvorak)Ammunition
@AndrewSmart They are the same; I made them both. The Xkb (Linux) version is modular, though, you can choose whether you want the numpad or not. The keyboard layout architectures on Windows and macOS don't allow that.Im
@Im They are not the same in my user experience. It must be a bug in the MS Windows executable published on your website then. On Windows 7 when using that programmer dvorak layout the q key was mapped to " (double quote), and the z key to ; (semicolon). There were many more differences, I had to make my own which matched the one on Linux. I love the one on Linux, tyvm if you indeed made it!Leung
I
26

Didn't see this mentioned, so I thought I'd add this: I'm using the Dvorak layout on a QWERTY keyboard, with QWERTY command key layout. Means every time I press the command button (I'm on a Mac), the QWERTY layout applies. So I'm typing completely "blindfolded" with the Dvorak layout, but I didn't have to re-learn the keyboard shortcuts. Has worked great so far for the last 4 years and I wouldn't change back to QWERTY.

The only downside of this is when using VIM, but nowadays I mostly use vim only for simple things, e.g. modifying config files over SSH.

Indolent answered 15/10, 2009 at 15:16 Comment(1)
How did you remap the command key layout?Purser
S
17

You may want to consider the colemak layout. from the faq:

Programming languages make heavy use of punctuation symbols. Colemak keeps almost all of the punctuation keys in their QWERTY positions to ease the transition from QWERTY. It depends on what programming languages you use, variable naming conventions (CamelCase vs. underscores) and what editor you use. In the end it's a matter of personal preference. You'd might want to remap the AltGr sequences to punctuation symbols you use often.

Spittoon answered 3/8, 2009 at 17:2 Comment(6)
+1. Never heard of Colemak, but they hit a few sweet spots about Dvorak in that FAQ, especially with the pinky-reaching. And a Vim remapping?! And Linux support?!! I'm definitely trying this out. On the "social" side of keyboard layouts, Colemak can't be worse than Dvorak in any way, and if it's better on the physical strain side... We might have a winner here.Booze
I think the thing to point out is that for English, Dvorak is a significant win over Qwerty, whereas Colemak is a marginal win over Dvorak.Oratorian
so does that mean that colemak is marginally significant over qwerty?Balinese
@DmitriNesteruk If Dvorak >> QWERTY and Colemak > Dvorak then Colemak >> QWERTY, right?Pinkham
@DmitriNesteruk since Dvorak >> QWERTY, former's benefits are not disputed. But since Colemak > Dvorak the former's superiority is not unanimously accepted. Though Colemak has distinct technology advantage, I have some reservations.Compatriot
I feel Colemak more suitable for usual typing, not programming. As the symbols lies heavily on right side (under your pinky territory!)Keenakeenan
H
9

The purpose of the Dvorak keyboard is to prevent strain on the hands by keeping the most typed letters on the home row, at least for English. I highly doubt this would help with programming in any significant way due to the speed at which code is written. I always think about what I write as I write it, and variable names are never completely conforming to standard English. In fact, I would not be surprised if the letter frequencies in a typical file of source code varies dramatically from established English letter frequencies.

If you suffer from something like Carpal Tunnel, Dvorak may help alleviate that. I'd have to say that the Dvorak keyboard probably helps with regular writing and typing far more than with programming.

Hillside answered 3/8, 2009 at 12:42 Comment(1)
If you're using snake_case to name your variables for greater readability or as is the custom in languages like Python, then you will find Dvorak is actually much easier as the underscore key "_" is on the home row making typing these variables much easier and more natural to type. Also the + and - keys are only one key away from the home position as opposed to 2 rows in the QWERTY layout.Proselytize
P
8

QWERTY and Dvorak keyboard layouts were designed for typing text not code.

You can try layouts for typing code like this one: Programmer Dvorak Keyboard Layout

Pals answered 3/8, 2009 at 12:50 Comment(3)
Programmers use lots of keyboard shortcuts. Many keyboard shortcuts are easier on Qwerty than Dvorak. For example, cut, copy and paste - ctrl+x, ctrl+c, ctrl+v.Baronetage
Just remembered why I found this is such a problem. Often, I tend to have my right hand on the cursor keys and the left hand doing the keyboard shortcuts. Lots of programs seem to be designed for this, with a strong bias towards shortcuts for left hand only. On Dvorak the shortcuts get all mixed up and many of them end up requiring two hands. Since users are all different though, maybe you won't find this to be a problem.Baronetage
many shortcuts have alternatives. Perhaps I'm old-school guy because I use ctrl+Ins, shift+Ins instead of ctrl+c, ctrl+v :-)Pals
C
7

I've been using Dvorak for more than 1.5 years. The reason of using Dvorak layout is not the speed, but the comfort itself. You think more than you type code. I code mostly using emacs, however, I'm not using default keybinding. Since emacs is relatively highly customisable, I use Ergoemacs keybindings. It really helps me to code in emacs, while retaining my Dvorak comfort without jumping here and there when I want to do an emacs operation which mostly done using key combination.

Carpospore answered 31/10, 2010 at 7:48 Comment(0)
M
1

Being used to dvorak can be a bit of a problem if you're working in a team or something like that where you type on other peoples computers.

Mendelson answered 3/8, 2009 at 12:49 Comment(3)
If you use the normal ANSI layout, there's a Dvorak layout integrated with XP, Vista and most normal Linux distros (actually, these come with localized variants, and XP does not). So it's just a matter of enabling the language bar applet.Tupelo
I've always been the only one that uses Dvorak among all my other peer developers. It's not a problem. They don't type on my computer and I don't type on theirs. I just feel sorry for them having to suffer through QWERTY. Once you learn dvorak you see how awful qwerty really is. It's just hard to notice until you've learned dvorak.Demantoid
This happens enough, that Dvorak typers like me eventually learn to switch between keyboards on the fly. I can't type at the same speed in Qwerty, but it is doable.Proselytize
T
1

I use a Dvorak-es layout -optimized for the frequency of letters in the Spanish language- both for programming and typing, and the special keys (){}[]<>/* etc. are the same in this and Qwerty.

If you're doing the switch to Dvorak, perhaps it would pay to design your own "Programmer's Dvorak" layout with the standard QWERTY positions for these keys. At least on Windows you could use the MS Keyboard Layout creator to do this.

Tupelo answered 3/8, 2009 at 12:52 Comment(1)
Do you know how to config dvorak spanish in windows 10? I need help with that. In linux it is just one command: setxkbmap dvorak es. Is there such an implementation in microsoft?Thekla
S
0

Well any keyboard can be appropriate for programming. It just would matter if you find it comfortable for typing because it breaks your way of typing with QWERTY.

On a side note, this keyboard would be awful for left-handed people such as myself.

Sokil answered 3/8, 2009 at 12:43 Comment(4)
Except for the left-handed Dvorak ;)Return
Because QWERTY is so much better for left-handed people? Dvorak, AFAIK, is also designed to spread the workload evenly on both hands, so being right- or left-handed should not matter.Tupelo
It looks like it has more dominate stuff on the right hand.Sokil
Yh, vwls rn't frqntl sd. Seriously, Dvorak did quite a bit of studying to create the layout, he didn't say 'it looks like this is more efficient'.Tupelo
B
0

Similar to the previous answer - any keyboard layout can be appropriate if that is what you feel comfortable with and can work efficiently with. Dvorak could always be a possiblity if you're interested in it - why don't you give it a try? I'm sure you can find an old keyboard to switch a few keys around on.

Worst case scenario: you revert back to qwerty. :)

Link

Black answered 3/8, 2009 at 12:49 Comment(2)
The worst case scenario you point out is a bit simplistic. It took me a couple of weeks to learn Dvorak, and during it, I was less productive. It paid off, and I wasn't working at the time, but not many people can just shrug off 2 weeks of lost productivity at their job.Tupelo
I don't see how this can directly effect productivity - For me, at least, switching to a new keyboard layout is not going to have a massively detrimental effect on my logical thinking of how I'm going to get around the next bug set. Perhaps for people in report style-job where you are constantly typing without too much of a break - I can understand your point. I take what you said on board though, perhaps I was being simplistic in my conclusion.Black

© 2022 - 2024 — McMap. All rights reserved.