I used the same keyboard for a number of years. It was one of the thinnest keyboards on the market with a fancy scissor like key mechanism, but this fancy pants key design contained a deep flaw. The plastic on the keycap that connected the keycap with the scissor mechanism was very brittle and eventually the material got strained and the key fell off.
Usually the keys that are going to fall apart are the ones that are useful and were pressed the most (Backspace, Enter, E, A, etc…). I didn’t have a spare key since I had already replaced all the broken keys with the ones that I rarely used, thus I had to find another keyboard. Looking around in the office for an unused keyboard revealed an unfortunate reality - most professional programmers are using cheap consumer grade keyboards.
Early in my career I happened to work on a construction site of a relatively large residential building. It was a classic civil engineering project - a large project went off the rails, which lead to poorly done plumbing, which lead to water leaking everywhere and after a decade the building was ready to be remodelled (which in civil engineering lingo means it was a disaster).
A typical construction site is a wonderful mess with lots of people running around doing all sorts of stuff: from the ones that are demolishing the interiors with jackhammers, electricians running the wires, plumbers tightening their pipes and turning the water off an on again, to supervisors that are trying to control this circus and ensure everything was done according to the standards and regulations.
Each group of workers, that are running around on the construction site, has their own set of tools which they are carrying from one problem to another and from one construction site to another. If you take a closer look at what kind of tools they are using, you will realize that they are not using the ones from your local “Do It Yourself” (DIY) shop. In fact, a DIY shop is not even selling the professional grade tools, because they are way too expensive for what their typical customer is willing to pay.
In the same way, a professional demolisher is not going to buy a consumer grade jackhammer, since they are well aware that a cheap jackhammer is not the kind of tool that will survive the harsh environment of the construction site. Best tool for the job and yadda, yadda. Somehow, this mentality has not yet caught up with the programmers.
Programmers seem to be just fine with using a regular Joe computer, a regular Joe monitor, a regular Joe mouse and a regular Joe keyboard. There is a lot to be said about our hardware, but to keep this post somewhat manageable I will focus specifically on keyboards 1.
A brief history of a modern keyboard layout
In the beginning, when somebody wanted to write a note, they had to write it by hand. In the early 1880s the first commercial typewriters appeared along with the grumbling of the elders about the rapidly deteriorating handwriting of the younger generation.
The typewriters eventually ended up with the QWERTY layout which we are still using today. This strategic placement of the keys was apparently put in place to prevent the typewriter from jamming.
The keys were organized by the Sholes brothers in 1873 to minimize the jamming of typebars in their early design of a typewriter. They placed the keys that were typed successively as far apart on the keyboard as possible so that the type bars would approach each other at a relatively sharp angle, thus minimizing the chance of jamming. Ease of learning or typing were not considered; another triumph of technology over human factors (see Beeching, 1974).
- Norman, Donald & Fisher, Diane. (1984). Why Alphabetic Keyboards Are Not Easy to Use: Keyboard Layout Doesn’t Much Matter. Human Factors. 24. 509-519. 10.1177/001872088202400502.
Since we are no longer using the jamming typewriters, does it make sense to use the same layout? Of course! Who wants to spend the next few months fumbling around and learning how to type again?
But not everybody shared that thought. In 1963 August Dvorak patented a new keyboard layout called Dvorak as a more ergonomic alternative to the QWERTY layout. Despite the ergonomic benefits, the Dvorak layout somehow never got popular and we are still happily smashing on the good ol' typewriter’s layout.
I’m tired of trying to do something worthwhile for the human race, they simply don’t want to change!
Programming is not writing prose
The QWERTY layout was designed in the era of typewriters which were designed for writing plain text with little to no special symbols. Unfortunately, programming often involves typing symbols (brackets, braces, semicolons, backticks, etc…), which were not present in the original QWERTY design. Since the keyboard manufacturers didn’t dare to redesign the layout and force everyone to relearn how to type, these additional symbols were simply added to the right side of the existing QWERTY layout which introduced a new problem.
A lot of programmers are typing in some variation of the touch typing technique which advocates keeping your hands on the so called home row. The 4 fingers of the left hand should rest on keys: A, S, D, F, the 4 fingers of the right hand should rest on keys: J, K, L, ;, while both thumbs should rest on the space bar.
If you are programming in a C-like programming language that involves typing lots of braces and semicolons, then typing on the QWERTY layout is not going to feel that great. If you follow the best practices of the touch typing technique, you also end up mashing the braces and semicolons with your weakest finger - pinky. For programmers with sausage like pinkies the keyboard layout doesn’t matter all that much, but for the rest of us with more elegant fingers, hitting special symbols with the right pinky for 8 hours a day is as pleasant as visiting the dentist - it hurts.
For this reason, I believe the QWERTY keyboard layout is an entirely inappropriate layout for programming. Frequently used symbols should be moved away from the right side towards the middle of the keyboard - a place which you can hit with your strongest fingers (thumb, index or middle finger).
Some of the non-US keyboard layouts did exactly that, but you are also forced to hold AltGr (right alt) in order to type symbols instead of letters. While moving from a single key press towards two may sound like a big drawback, it’s actually not that bad and your brain adapts to the new layout in a few days anyway. The pinky pain was also the main reason why I moved away from the US layout.
But why are we even using the keyboards that were designed for writing plain text? If we have learned anything from the aforementioned construction site example, aren’t we supposed to use the best tool for the job? For a task that involves typing lots of characters mixed with special symbols, I think we should also be using a completely different tool compared to what an every day computer user is using.
The perfect keyboard
Going around in the office and asking 10 different people about their perfect keyboard will most like produce 10 different answers. What follows below is just my opinion on how an improved programming keyboard from the future would look like. In the past there were some attempts to create a better keyboard for serious typists (Happy Hacking Keyboard comes to my mind), but looking at the changes they made it doesn’t seem like they brought anything new to the table.
Let’s take a look at some of the changes that I would make to the existing ANSI layout to improve the user experience for programmers:
A-Z keys: given the history of the QWERTY layout, it looks like the layout is completely arbitrary as we are no longer using the typewriters. While there were attempts to improve the layout (Dvorak, Colemak, etc…), these alternative layouts didn’t get much traction. If we have learned anything from the past, completely redesigning the keyboard layout is off the table since very few people are willing to invest the time into learning how to type again.
But just because redesigning the entire layout is not viable, that doesn’t mean we can’t remove some of the old skeletons that are dragging along since the early typewriters.
Caps Lock: I don’t use the Caps Lock key and I usually disable it right after installing the operating system. Some like to turn it into an extra Escape or Control key. If you are using an ancient keyboard it could also be turned into the missing Super/Windows key. For the next generation keyboard, I would probably replace it with the new FN (function) key that would unlock new capabilities (layers) that will be described in more details later on.
At this point it’s also worth thinking about the Caps Lock key size. Why is the Caps Lock slightly bigger than the Tab or the Control key? It’s due to historic reasons coming from the typewriter’s era and its extra width brings no benefits today (unless you count accidental Caps Lock presses as a benefit). I also think that touch typing on ortholinear keyboard would be easier, due to not having to move the fingers diagonally which sometimes forces you to unnaturally bend your wrists.
What about those poor saps who still have to program in ALL CAPS? Well, I would let them lock the caps via a a FN + Shift key combination. Press the combination once to turn it on and press the combination again to turn it off. There is no need to have a separate key taking a valuable space on the home row for such a rarely used action.
FN - Function Key: the function key would replace the current Caps Lock key. The whole point of having an extra key near the home row is to allow you to trigger your own actions or macros by holding down the FN key and pressing one of the keys on your keyboard.
A lot of programmers and system administrators are using Vim for editing text files directly in the terminal. Vim allows you to move the cursor around in the file without having to use the traditional arrow keys and moving your hands away from the home row.
The next generation programming keyboard would allow you to do the same - when the FN key is held, the HJKL keys would act as an arrow keys. The FN key would be programmable, so the end user would be able to record their own actions like remapping the movement from HJKL to JKL; if that suits them better.
The FN key is not a new idea and it’s a well known feature in the keyboard modding community, but I don’t see any reason why something like this couldn’t become a standard keyboard feature.
Super/Windows key: the default behavior is to open up some sort of an application launcher (so called start menu). How often do you really open new applications during a programming session? Not that often, but hey, it’s not like I have any better idea on what to do with it.
Alt key: it’s most often used in the key combinations (e.g., ALT+F4), accessing the main menu via a keyboard and entering special characters with alt codes. Considering it’s often used for shortcuts I would leave the alt where it is.
Numpad: I never use the numpad since it’s too far away from the home row. It might be useful if you are entering numbers all day long, but since I am not doing that I would prefer to cut it off entirely (also known as the tenkeyless layout). The numpad removal also brings your mouse closer to the center of your body and reduces the slight strain that you may feel in your arm.
Print Screen, Scroll Lock, Pause/Break: I don’t use them, because they are too far away from the home row. Still, they could be turned into a global shortcuts for less frequently used actions. I turned mine into the shortcuts for handling volume (mute, volume down and volume up), since my current keyboard does not have a dedicated keys for that. The next generation keyboard would do the same, except it would have the right volume actions printed on the keycaps.
F1-F12 keys: F keys look like the type of keys that could be used for your own global shortcuts (for example, you could turn F1 to clipboard paste command). It turns out that a lot of IDEs are using them for controlling the debugger, therefore the programming keyboard simply can’t get rid of them.
Space bar: the space bar on most keyboards is absolutely giant. I usually hit the space bar somewhere in the middle, while the rest of it was probably never even touched. Its massive size is only taking up a valuable keyboard space, thus I would simply shrink the space bar for at least 2 keys and introduce two new keys at each end for typing braces and brackets. This strategic position would allow you to hit braces and brackets with your strong thumbs as opposed to the weak right pinky.
A careful reader might notice that by making these improvements to the current ANSI layout, we have freed up some keys that could be used for new actions. The changes described above may be hard to imagine, so let’s take a look at the final state of the perfect keyboard for programming.
The first difference that you may notice is how much narrower the keyboard is in comparison to the full ANSI layout. The width went from 22.5 keys to just 16 keys without losing any functionality; one key is 18mm (0.71") wide, thus the keyboard went from 405mm (15.9") to just 288mm (11.3").
Some custom keyboards are trying to further shrink the keyboard by removing every key but the letters, and introducing new modifier keys that are unlocking special layers in order to get the previous keyboard functionality back. When it comes to programming, I don’t think that removing frequently pressed keys such as F-keys or numbers is a good idea. If the key is frequently used, it should be put on the separate key as long as that key is easily reachable.
Obviously the imagined layout is not perfect and I am sure there are ways to improve it further. I tried to change the current QWERTY layout as little as possible, so that most people would still be able to type without a drastic change in their typing habits. I kept the arrow keys as well as the Page Up/Page down keys. They could also be removed and moved to the FN layer entirely, but some programmers like to use them and therefore I left them in.
Since I’ve added the new brace keys at each end of the space bar, I could in theory also remove the old brace keys or replace them with new keyboard actions. The problem, however, is that such keyboard would not be usable in countries that are using more characters than just standard A-Z (a German layout comes to mind). Letters with diacritics are usually placed on the brace, semicolon and apostrophe keys, so you can’t just remove them. I made my peace with not using diacritics in my non-English texts, but others may be more adamant with keeping them in; especially Germans, they love their ä, ö, ü and ß characters.
Why don’t you rather…
Any change you make to the existing QWERTY layout is going to cause problems and probably upset some potential users. We know from programming that when you are trying to make something as generic as possible, you also make it unusable to some extent. A custom library tailored to your specific problem is often a more suitable approach than shoehorning a generic one into your system.
With that in mind, I will briefly touch some of the questions one may have after reading this article.
You didn’t change the location of the semicolon key?
I would probably move it somewhere in the middle of the keyboard that could be typed either with FN + key or AltGr + key (e.g., FN + D or AltGr + D or even Shift+Space). If it’s placed on the key with a letter, it should definitely be put on the left side of the keyboard as the left side does not have any special symbols assigned and that would significantly reduce the right pinky usage.
It would be even better if our programming languages would get rid of the semicolons entirely, but you may as well wish for an unicorn. There is too much existing code out there, thus we have to pick another workaround for those pesky semicolons.
Why don’t you move Backspace, Delete and Enter?
Since those keys are bigger, I usually hit them with my ring finger and therefore I don’t find their position as problematic. For the same reason I also didn’t move the keys on the left side (Tab, FN, Left Shift, Control).
What about the operating system layouts?
I am not a fan of switching the keyboard layout via the operating system and allowing it to mess up with my hotkeys. I think a better approach would be to have a layout and shortcuts baked into your keyboard, so that every time you plug it into a computer you would have the exact same layout regardless of the operating system settings. Tweaking and baking a new layout into your keyboard also shouldn’t require having a PhD in Electrical Engineering either, but that seems like a solved problem if you are using something like a QMK firmware.
There may be some drawbacks with this approach that I am not aware of, but keep in mind we are trying to improve the typing experience for a specific group of people and not making yet another generic keyboard for the Joe next door.
Where can I buy it?
Unfortunately, the chance of such a keyboard appearing on the mass market is quite small. After all, which of the big keyboard manufacturers would like to go through the hassle of designing a new keyboard just to discover that most people don’t really want their keyboards to change?
(If you are working for one of those manufacturers, please let me know why is there so little progress in this space. Alternatively if you are trying to create a new keyboard with some of these ideas described above and you need a serious keyboard tester, feel free to reach out via the Contact page)
Snooping around the nearest store revealed that the keyboard market looks rather grim. What is currently available on the high end of the market are mostly gaming keyboards with bright RGB lights, keyboard configuration stored in a cloud and in some cases even some kind of a social media integration.
Really? Who needs this junk? These features are only there to justify the premium price, while these “premium” keyboards offer little to no improvements over the cheap ones. A serious typist is never going to look at the keyboard anyway, so having any kind of lightning or social media integration is a complete nonsense. I guess the teenage gamer’s market is bigger and more lucrative than the market for serious typists, hence we are where we are.
I know there is an entire subculture revolving around building a custom mechanical keyboards, but do you really have to build your own in order to get a high quality keyboard these days? The best part of these DIY keyboard sets is that they don’t seem to be any different from what you can already buy on the market. They are still following the flawed ANSI layout with staggered keys, a huge space bar and an useless Caps Lock located on the home row. What’s even the point of such set if you end up with an essentially the same keyboard that you can already buy at the store?
Imagine telling your local construction guys that they have to build their own jackhammers in order to be able to work effectively. They would laugh you out of the room. Imagine telling your boss that you have to design and build a new keyboard in order to program effectively. They would laugh you out of the room.
Now, where is my solder?
Just to briefly mention the problem of modern monitors: the so called Full HD or 1920×1080 resolution doesn’t really seem that great for programming. The monitor is very wide, but it’s not wide enough to comfortably put two source files on the same monitor unless they are wrapped at 100 characters. Hard wrapping at 100 characters is too narrow for my taste as it breaks the lines in unnatural places and consequently makes the code harder to read (the more verbose the programming language is, the more characters per line you need).
I think a sweet spot is a 27" monitor with a QHD resolution (2560×1440 pixels). The size of the pixel should be roughly the same as it is on the regular Full HD monitor, but in order to show more content you want more physical pixels (if you make an exact pixel size calculation, you will find out that you would actually have to get the 31" screen). ↩︎