Best keyboard layout for a programmer? [duplicate] - programming-languages

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
An Ideal Keyboard Layout for Programming
As a programmer I don't type as much human language as normal users. In fact, a lot of what I type are ASCII special characters such as $();:?=+-'"\[]{}<>. Needless to say, QWERTY is not good at programming.
function decode($t)
{
return preg_replace('/<(\/)?('.tuh::$tags.')>/i','<\1\2>',$t);
}
So I'm thinking about trying other layouts like Dvorak or Colemak, but they don't seem to be much better (Even the programming versions). So is there one that actually places the common keys right there next to the home row? No more stretching for each $ or ]?

I'd still say qwerty just because; at least in my job; I use a number of different keyboards/computers during the day and the adjustment can be rough moving across.

Related

Are alternative keyboard layouts like Dvorak, Colemak, etc. better than QWERTY? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
There are many alternative keyboards to the standard US keyboard layout (called QWERTY).
Some examples include Dvorak, (and variants like Programmer Dvorak), Colemak, AZERTY, Workman layout, etc.
Do any of these confer a benefit to typing speed, accuracy or hand/wrist-health?
And, if so, which one of these should I choose as a touch typist if I am regularly programming?
Short answer:
If you are happy with your keyboard layout, stick with it.
Long answer:
I will try and aim to make this as definitive and explanatory an answer as possible. To understand a bit where I am coming from, allow me to express my own journey through this jungle:
I am a computer science student who started out with the German QWERTZ keyboard, typing at about 100 WPM (words per minute). When that turned out to be horrendous for programming, I moved to QWERTY. Then, I got taken in by the hype and turned to Colemak. After mastering it, I discovered there was a layout optimized for programming, and switched to Programmer Dvorak. Finally, still not happy, I tried to design my own keyboard layout semi-scientifically. And finally, now, I am typing these lines on QWERTY. (To save others the trouble and pain I went through).
Therefore, I will try to argue in my answer both from personal experience as well as from scientific published data.
The main arguments for all the alternative keyboard layout hype can be summarized to three major points:
The QWERTY keyboard is slow and was designed to slow typists down.
Excessive use of QWERTY causes Carpal Tunnel syndrome and is bad for your health.
Dvorak/Colemak/< Insert alternative layout here > was optimized to increase speed/accuracy/health
Let's go through this one by one:
First, the argument that the QWERTY keyboard was designed to slow typists down is simply not true. It was nicely debunked in this question. The QWERTY keyboard was designed to stop the keys from a certain model of typewriter to stop jamming. Rest assured, we will discuss the "QWERTY is slow" myth in a minute.
Second, the ultimate argument that advocates of alternative keyboards love to use is that QWERTY causes Carpal Tunnel syndrome, because it strains the fingers.
What's amazing here is that this is actually an Urban legend which has persisted despite it being discredited. See this question here. To quote from the answer by Graeme Perrow: "It seems that using computers in general does not cause carpal tunnel syndrome, regardless of the type of keyboard."
Finally: If QWERTY wasn't made to slow typists down and doesn't cause any illness, why use another keyboard? The answer usually offered is because other layouts are faster and have the keys aligned in a "smarter" way.
We are told how much faster typists can be when they use Dvorak instead of QWERTY and how the home row of colemak offers great benefits to productivity and speed.
We are treated to an avalanche of impressive-looking percentages, of how much faster and accurate you can be on an alternate keyboard, rather than a humble QWERTY.
However, if you look at hard, scientific evidence, you find... nothing worth writing home about. Indeed, there are two very interesting posts here and here: It turns out that the (very hard to objectively measure) speed gains are a measly 2% to 4%.
This mimics what I myself have experienced: If you are a trained typist, then switching doesn't give much of an improvement. After I had finally finished my switch to Dvorak, I was still typing at roughly 100WPM. If you want to go beyond that, you have to type a lot during your day.
I believe that the reason people observe a speed-boost when they switch is that they have to retrain their muscle memory from scratch. Which, if they do diligently, is rewarded with a faster typing speed. The irony is: I conjecture that if they had "retrained" QWERTY from scratch, they would have obtained the same speed increase.
Additionally, my own error rate didn't go down with Dvorak or Colemak. It stayed around the same level. Which, again, is not dictated by the layout but by the accuracy with which one has trained their muscle memory.
Lastly, on the note of programming: It is true that for programming languages, on QWERTY the keys used often, such as {}, [], ', =, +, -, _, etc., are all to be reached with the right pinky, which drags performance down. This still is not worth the switch to something like Programmer Dvorak, however, since, especially in programming, the limiting factor is rarely typing speed (once you get above 60WPM, that is).
So given all this, there are also a few downsides to switching that I wish to elaborate:
Dvorak suffers from the huge disadvantage that all computers use shortcuts (such as the famous CTRL+C and CTRL+V) which, on the Dvorak, are in different and hard-to-reach positions. Colemak doesn't suffer from this as much, since it kept the C, V and B key positions from QWERTY. However, even with Colemak, using programs which rely heavily on shortcut use (the most notorious of these being software like vim and emacs), has to be relearned from scratch.
Switching takes a very long time. Let nobody fool you. If you were typing at >80WPM, I can tell you from personal experience that it takes months to achieve this speed again. Even if you swap only a few keys (like Colemak), it is still a painful and long process.
When you successfully switch, you will be unable to type fast on regular QWERTY keyboards anymore (take my word for it). You will still be faster than someone who doesn't use touch typing, but if you ever have to type on a QWERTY computer as an alternative typist, you will be in for some embarrassment. This can get especially hairy if it is work related.
Many alternative layouts are not nearly as standardized as QWERTY. In other words: If you use an older machine, for instance, you may find your preferred layout not installed. This is a further hassle, because then you have to get around that problem by downloading and installing the layout you chose, meanwhile having to work in a layout you can no longer use.
Thus, in conclusion, my advice is: If you are happy with your current layout, keep it. The benefits of changing are much too small to consider. Especially if you are a QWERTY typist, I recommend staying with it. It will save you a lot of hassle and annoyances.
Long story short: QWERTY was not designed for touch typing. When compared with nine other layouts, QWERTY comes in dead last in typing effort. Give other layouts a try and experience the difference.
Whether the QWERTY layout was intentionally designed to slow typists is irrelevant. QWERTY is inherently slow by design.
The ultimate argument made by alternative keyboard advocates is that QWERTY is an inefficient, sub-optimal keyboard layout and that better layouts exist that suit modern touch typing technique. Whether one subscribes to the belief that QWERTY is a contributor to carpal tunnel is another story, yet many anecdotal stories exist of people who have reduced RSI by switching.
You should use a non-QWERTY keyboard layout because a non-QWERTY keyboard layout is easier to use. Switching to Dvorak or Colemak reduces distance traveled, reduces same finger typing, increases hand alternation, increases hand balance, and optimizes performance according to finger strength. Switching to Dvorak alone reduces effort by 30% (i.e not 4% as suggested, see first link). Note that these benefits accrue over time with use. The idea that there is no benefit to switching is simply untrue. And with newer layouts such as Colemak, typists don’t have to relearn to type. 48% of the Colemak keyboard layout is identical to QWERTY. Even if one’s error rate doesn’t fall (highly unlikely), alternative keyboard layouts like Colemak remap backspace to an easier to reach spot.
Regarding said downsides:
Windows and Mac offer the ability to use familiar QWERTY shortcuts while pressing Ctrl/Cmd. Many people have devised ways for using emacs/vim while switching.
Switching can be very painless and easy considering there are websites such as keybr.com that teach how to master touch typing using Dvorak or Colemak.
Whether you can type as fast with QWERTY after switching is irrelevant. Once you switch, you are set and won't have to go back to QWERTY on your own device. Dvorak and Colemak are standards or can be easily installed on to all major operating platforms. If you are going to use others keyboards and aren’t able to switch the layouts, there are numerous online keyboard simulators.
The hassle of switching the layout on the computer is very minimal if nonexistent compared to the hassle of typing on QWERTY.
Advice: The benefits of switching are too large not to consider. You have nothing to lose by trying; if it doesn’t work out, you will always have QWERTY to fall back on. Let your keyboard work for you, not the other way around.
My two cents worth...
I switched from QWERTY to Colemak a few years back, mostly because I like to try out new things but also because I was getting a bit of RSI from all the typing I do.
I found the transition took a few months, with the first few weeks being most painful -- I took a lot of handwritten notes in meetings in this period! But perseverance paid off, I'm now typing at about 60-70 wpm, which is faster than my old QWERTY speed, and I can touch type properly, plus I don't get the RSI pains any more.
Now, much of this might be because I learned to type properly in Colemak (using programs such as GNU Typist) whereas I don't recall ever learning QWERTY properly. But I would say that Colemak definitely feels nicer on the fingers, with less movement around the keyboard for most words.
I'd also add that Colemak is supported as part of the base OS on Mac and popular GNU/Linuxs (e.g. Debian and Ubuntu), and easy to install on Windows, so would consider it fairly mainstream.
I agree with #mark-anderson I am typing on dvorak and the worst part is that shortcut keys are a pain - I use a tool for that (see my answer at https://stackoverflow.com/a/22945703/18132). Using someone else's keyboard is also a pain.
On the plus side, I can touch type and never have to look at the keyboard. actually if I look at the keyboard I get confused since the keys are in the wrong place.
Was it worth it? Not really sure. I like that I can touch type. I like that I can use qwerty shortcuts but my hand still hurts and I think I might be faster - not really sure. But I am considering switching back to qwerty - I have been dvorak for 2+ years now, so I don't really have a good reason to switch back other than to "conform" :)

Why "hjkl" is highly recommended? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
VimTutor arrow keys v/s hjkl
Why "hjkl" is highly recommended?
I think it's more convenice using arrow key.
Is there any advantages using "hjkl"?
It is a bit like using the mouse. Every time you reach the mouse, or the arrow keys, you have to move your hand back to the main part of the keyboard to access other very common commands like i, y and you will lose some time.
Rather than the time, I think that the main issue is you are losing some focus on what you are doing, because you have to look at (or think about) your hand rather than the screen.
You keep your fingers on the home row and if you're using touch typing (which you should) you are much faster at editing.
Check this page to get more info.

What is the best way to learn Touch Typing? [duplicate]

This question already has answers here:
Closed 13 years ago.
Duplicate
How do I improve my Typing Skills?.**
I tried the test on http://speedtest.10-fast-fingers.com/. I reach only:
You type 337 characters per minute You
have 58 correct words and you have 1
wrong words
How can I improve my typing speed? What free resources do you know of?
Should I learn the Dvorak Keyboard?
Practice is the best way to get faster. I've found TypeRacer to be a fun and easily accessible game. Using it I quickly got from around 55 words per minute to over 70.
I removed all of the key caps from my IBM Model-M. Since I can't see the letters, I was forced to learn their positions and type without looking at the keys other than to initially orient my hands. When you're not able to take shortcuts, you tend to learn very quickly.
Mario taught me.
I also took the test and reached 371 characters with one mistake. However, for programming, I would not see this as a bad result. I'm more worried about how to use tools like Intellisense and code templates better to speed up my coding. The jedi coding demo shows that you can get much higher gains that way than by doubling your typing speed.
No need to learn Dvorak according to XKCD (and more here).
I also remember reading in The Design of Everyday Things that QWERTY actually does quite a good job or spreading the commonly used letters across your fingers and whilst the Dvorak keyboard is a little better than QWERTY the benefits aren't significant enough to justify making the change. (If I can find my copy I'll try and put up an exact quote.)
As with all things: practice makes perfect. Making posts on StackOverflow is a start :)
Unless if you want to win typing contests, a Qwerty or Azerty keyboard will work just fine.
You don't need to learn Dvorak. I can type 600+ Chars/minute on a querty pad, no problem.
The key is: Repetition, repetition, repetition.
What you're doing while you learn typing is creating new 'highways' straight form your brain's spelling center through your spine to your fingers.
Hence, a good typist will spell a word in his mind, and his fingers 'automatically' type those characters because there's a 10 lane highway from his brain to his fingers. In your case, it's a modest 3 lane highway.
Practice, practice, practice.
Good training for if you already know how to type : www.play4traffic.com
There's also loads of typing tutor programs available online, but the key is repetition and persistance.
My native language is Dutch, so in english it's not as good. I tried the test you gave:
317 points, so you achieved position 194065 of 2927935 on the ranking list
You type 476 characters per minute
You have 80 correct words and you have 4 wrong words
Why?
Why do you want to type more quickly? I seldom find that my fingers or typing speed are the issue when it comes to software development. Sure I have a fair speed, but programming is about SO much more than typing speed. I've been using a QUERTY keyboard since about 1983 so I guess repetition helps.
But learning to hold back on typing and thinking about what it is you're about to do is far more valuable IMHO.
Having said that, I would expect any developer to be able to type reasonably quickly using most fingers, or at least more than their two index fingers ;)
This game taught me a few years back.
The Typing Of The Dead
I can now type fairly quickly without looking at the keyboard. You need to learn to use the correct hand position. Then you must have good discipline and only use the correct finger to type the correct letters. I even went so far as to delete correct chars typed with the wrong finger.
It takes time, and you will almost definitely go slower before you go faster, but it is worth it.

Why are there so few modal-editors that aren't vi*? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on)
Early software was often modal, but usability took a turn at some point, away from this style.
VI-based editors are total enigmas -- they're the only real surviving members of that order of software.
Modes are a no-no in usability and interaction design because we humans are fickle mammals who cannot be trusted to remember what mode the application is in.
If you think you are in one "mode" when you are actually in another, then all sorts of badness can ensue. What you believe to be a series of harmless keystrokes can (in the wrong mode) cause unlimited catastrophe. This is known as a "mode error".
To learn more, search for the term "modeless" (and "usability")
As mentioned in the comments below, a Modal interface in the hands of an experienced and non-fickle person can be extremely efficient.
Um... maybe there isn't much of a need for one, given that Vi/Vim is pretty much available everywhere and got the whole modal thing right? :)
I think that it's because vi (and its ilk) already occupies the ecological niche of modal editors.
The number of people who prefer modal and haven't yet been attracted to vi is probably 0, so the hypothetical vi competitor would have to be so great as to make a significant number of vi users switch. This isn't likely. The cost of switching editors is huge and the vi-s are probably already as good as modal editors go. Well, maybe a significant breakthrough could improve upon them, but I find this unlikely.
#Leon: Great answer.
#dbr: Modal editing is something that takes a while to get used to. If you were to build a new editor that fits this paradigm, how would you improve on VI/VIM/Emacs? I think that is, in part, an answer to the question. Getting it "right" is hard enough, competing agains the likes of VI/VIM/Emacs would be extremely tough -- most people who use these editors are "die hard" fans, and you'd have to give them a compelling reason to move to another editor. Those people who don't use them already are most likely going to stay in a non-modal editor. IMHO of course ;)
Modal editors have the huge advantage to touch typists that you can navigate around the screen without taking your hands off the home row. My wrists only hurt when I'm doing stuff that requires me to move my hand off the keyboard and onto the mouse or arrow keys and back constantly.
Remember that Notepad is a modal editor!
To see this, try typing E, D, I, T; now try typing Alt, E, D, I, T. In the second case the Alt key activates the "menu mode" so the results are different. :oP People seem to cope with that.
(Yes, this is a feature of Windows rather than specifically of Notepad. I think it's a bad feature because it is easy to hit Alt by mistake and I don't think you can turn it off.)
VIM and emacs make about as much user interface design sense as qwerty. We now have available modern computer optimized key layouts (see the colemak layout and the carpalx project); it's only a matter of time before someone does the same for text editors.
I believe Eclipse has Vi bindings and there is a Visual Studio plugin/extension, too (which is called Vi-Emu, or something).
It's worth noting that the vi input models survival is in part due it's adoption in the POSIX standard, so investing time in learning would mean your guarenteed to be able to work on any system complying to these standards. So, like English, theres power in ubiquity.
As far as alternatives go, I doubt an alternate model editor would survive a 30 day free trial period, so its the same reason more people drive automatics than fly jets.
Since this is a question already at odds with the "no subjective issues" mantra, allow me to face that head on in kind.
Non-Modal editing seeks to solve the problem caused by non-modal editing in the first place.
Simply put, with Modal editing I can do nearly everything without my hands leaving the keyboard, and without even tormenting my pinky with reaching for the control, or interrupting my finger placement by hunting for the arrow keys.
Reaching for mouse completely interrupts the train of thought. I have hated the intense reliance upon this with Intellij IDEA and Netbeans for many years. Even with vim-style addons.
Most of what you do has to do with fine-tuning with very small increments and changes within the same paragraph of code. Move up, move over, change character, etc., etc. These things are interrupted with control keys and arrows and mouse.
Though not really answering your question, there used to be a "modal like" way to write Japanese on cell phones before :
The first letter you hit was a conson let's say K, and then, and then the next key you would hit would have the role of a conson. (Having two conson in a row is impossible in Japanese)
Though it was main a few years ago, today it's only used by people who really want to hit fast.
I think the answer to the question is actually there are quite a few modal text editors that aren't forks of vi/vim. However they all use the vi key bindings. Vi users get the key bindings into their muscle memory so relearning a different set of key bindings would be really hard, so no-one would create a different set of key bindings.
But lots of different editors have re-implemented the vi key bindings from scratch. Just look at this question about IDEs with vi key bindings. At least half of the answers are editors built from scratch that implement vi key bindings, not versions of vi embedded.
I recently came across divascheme - an alternative set of key bindings for DrScheme. This is modal, and part of the justification is to do with RSI - specifically avoiding lots of wrist twisting to hit Ctrl-Alt-Shift-something. The coder has done an informal survey of fellow coders and found that emacs users suffered from more wrist pain than vi coders.
You can see him doing a short talk at LugRadio Live USA. (The video is a series of 5 minute talks and I can't remember how far through it is, sorry - if someone watches it and posts that here I'll edit this post to say when in the video it is).
Note I have not used divascheme.
The invention of the mouse took one mode and moved it to an input device, and context menus took another mode and moved it to a button. Ironically, the advent of touch devices has had the reverse effect, producing multi-modal interfaces:
aware multi-modal - touch and speech are aware of each other and intersect
unaware multi-modal - touch and speech are unaware of each other and conflict
The traditional WIMP interfaces have the basic premise that the information can flow in and out of the system through a single channel or an event stream. This event stream can be in the form of input (mouse, keyboard etc) where the user enters data to the system and expects feedback in the form of output (voice, vibration, visual, etc) when the system responds. But the channel maintains its singularity and can process information one source at a time. For example, in today’s interaction, the computer ignores typed information (through a keyboard) when a mouse button is depressed.
This is very much different from a multimodal interaction where the system has multiple event streams and channels and can process information coming through various input modes acting in parallel, such as those described above. For example, in an IVR system a user can either type or speak to navigate through the menu.
References
User Agent Accessibility Guidelines working group (UAWG): Keyboard Interface use cases
W3C Multimodal Standard Brings Web to More People, More Ways
Next steps for W3C work on Multimodal Standards
The Future of Interaction is Multimodal
Beyond Mouse and Keyboard: Expanding Design Considerations for Information Visualization Interactions - naturalinfovis_infovis2012.pdf
Setting the scope for light-weight Web-based applications
Jan. 26, 1983: Spreadsheet as Easy as 1-2-3
Multi-modal design: Gesture, Touch and Mobile devices...next big thing? | Experience Dynamics

Best keyboard for custom Dvorak-based programming layout

I'm considering switching to a Dvorak-based keyboard layout, but one optimized for programming (mostly) Java and python (e.g. DDvorak, Programmer Dvorak, etc.). What particular keyboard would be best for such an undertaking? I'd consider either natural or straight keyboards.
Thanks.
I strongly discourage you from learning a layout that has been heavily optomized for any one programming language (or even a class of them..) it's much, much easier to change languages than keylayouts, and you'll have a lot of trouble finding the tweaked layouts on any random computers you need to use.
That said, I've used dvorak for years (something like 7-8 years now) on a Kinesis Contoured keyboard and it works wonderfully. The kinesis is programmable, switches between qwerty/dvorak, and you can remap the keys all you want (so you could try out ddvorak or programmer dvorak pretty easily, without making software changes, if you wanted).
The contoured keyboard also forces you to touch-type more "correctly", since you can't easily reach across the keyboard with the wrong hand.
Typematrix
(source: typematrix.com)
Plain vanilla dvorak is best imho. Yes, it does move 3 or 4 keys such as {}: etc out of the way, but you quickly get used to them in the new position, and after a while it makes no odds at all.
The pay off comes in being able to use any random pc - flick the keyboard layout to standard dvorak (which is on just about all PC's, unlike most obscure programmer layouts), and away you go. If you're used to a non-standard dvorak layout, and are forced to use a normal dvorak layout on a qwerty labeled keyboard, I suspect you're in for a whole ton of backspaces (and curse words).
I've only been using dvorak for a few years, but I can't imagine programming using anything else. (Especially with vim, the dvorak layout seems to end up with lots of the keys in much handier positions =)
oh, and as mentioned above - kinesis contoured keyboard is the way to go if you're considering changing layouts for R.S.I issues.
I think the ErgoDox is probably the best option. You used to have to order the components and build it yourself, but now you can purchase it assembled. Here is what it looks like when completed:
I think the ErgoDox is the best option. Apparently the DataHand also supports Dvorak, but I think it would have a pretty steep learning curve:
The components for the ErgoDox typically run about $250 when all is said and done, although it can definitely be built for less than that. I think the DataHand costs around $800.
Any 'normal' keyboard should be pretty much adequate for dvorak, including simple ergonomic (split in equal halves) keyboards. Some of the more esoteric split-ergonomic keyboards that aren't equally split may cause problems with the way that dvorak weights the finger usage though.
If you're going to learn dvorak, I would personally avoid plain dvorak, as it moves punctuation commonly used in programming, such as parenthesis, brackets, braces, etc too far away from the hands: There are a number of 'programmer dvorak' implementations out there which adjust dvorak for this 'oversight'.
I started this post in reply to Tom's post but it grew slightly long.
I learned to touch type at the same time as switching to the Dvorak layout and found that using a qwerty keyboard helped a lot. It stopped me from being tempted to look down at the keyboard. There's no reason to need the labels if your going to touch type and learning to touch type is more important than changing to dvorak.
Right now I'm using the Programmers Dvorak layout that I've made slight modifications to and find it easier than qwerty was.
I recently found out about the Developer's Dvorak but think it's too different for me to learn while still being able to use normal dvorak. It changes the vowel placement and just about half the other keys.
If you are planning on using a custom keyboard layout that's very far from the norm it's good to have something like Portable Keyboard Layout that you can put in a portable drive to use on any [windows] computer.
Do you use a natural keyboard, or a straight one? Keyboard preference can be intensely personal, but many higher-end keyboards have keys fitted specifically for the location of the key (slant and curvature), meaning for Dvorak you'll need to ignore the labels, move the keys and eliminate that advantage, or go with something like the blank das keyboard
My BROTHER of keyboard land. I think I found the holy grail in terms of programming keyboards. Behold the keyboard that retains the layout within the keyboard. I have a custom Dvorak keyboard layout not particularly for programing, mostly for essay writing. I do program a lot though. That retains programmable macros within its brain. That has 24 function buttons. And that has mechanical switches (if it had cherry blue or buckling it would be perfect, it currently sports alps, which arent bad at all). It is based on the renowned Northgate omnikey.
CVT Avanat Stella
http://www.theregister.co.uk/2005/11/07/avant_keyboard_review/
On the other hand, you could go 150 bucks under with the IBM Workstation, its legendary buckling spring design is a holy grail among typists. And its 24+ function buttons should prove useful. Plus its vintage goodness is something any geek would adore.
Although switching a keyboard format through software is an easy fix, having a keyboard like the Typematrix helps alot. I've been using the Typematrix 2030 for 4 years now and own 2 boards. One is for work and the other is for home use. I can now use any keyboard I want but the typematrix is definitely more comfortable and timely. This keyboard comes with software that will aid you in learning Dvorak if you don’t know how to type yet.

Resources