Anže's Blog

Python, Django, and the Web

08 Mar 2012

Coding and keyboard layouts

Keyboard layouts are important, especially for us programmers, as we spend most of the day cranking out code. But some layouts seem to be better for coding than others. I have recently switched from Slovenian layout to the English one and I am really happy with my decision. Let me tell you why.

Slovenian keyboard is a mess

Slovene keyboard The Slovenian keyboard layout has 31 letters. This is 6 letters more than they are in our alphabet and 5 more than on a ‘normal’ keyboard. We even have two letters left over from Yugoslavia which we aren’t a part of for more than 20 years. Madness! There has been some talk about a new, refined standard a few years back, but I have yet to see an actual physical model. This means that we are stuck with the extra unneeded letters for the foreseeable future.

What does all this got to do with coding

The number of keys on a keyboard is more or less fixed for all the countries round the world. This of course means that those extra letters need to replace other characters. To access those one must do some weird finger acrobatics. Let me give you an example. Writing square brackets ([]) is really easy on a English keyboard, but on a Slovenian one it requires you to press two keys alt gr and f for [ and alt gr and g for ]. It is similar with curly brackets, the ‘at’ symbol, backslash and so on. These are all characters that programmers use very often and having to excess them by weird keyboard combinations is annoying to say the least.

Reasons why I now code on an English layout

It took me quite some time to decide to move to a different layout, even though @zidarsk8, @swizec and @majcnm were convincing me that the English layout is way better for coding. I was not keen on switching because I would still need to use the Slovenian layout from time to time, and switching between them causes confusion and errors. But once I tried to write a few lines of code with the English layout there was no turning back. Here are my reasons for finally switching:

  1. While writing code I do not need Slovenian letters at all. Writing code and comments should be done in English without an exception. And besides, have you ever tried putting a UTF character in a Python comment? Try it!
  2. Removing all those unneeded characters frees up space for the characters that you actually do need. Having easier access to brackets, front/back slashe and is a big performance boost.
  3. Most programming languages were made by people using the English layout. Naturally they chose characters that are quick and easy to type on a English layout.
  4. English layout is more universal than Slovenian, which means that I won’t be lost if I will have to do some coding on a foreign keyboard someday.

Now I am not saying that every developer should switch. I am just saying that worked for me. Also before somebody suggests Dvorak I am going to say that I’ve tried it but just couldn’t get it to stick. I am not convinced this is a good layout for programming and it sure makes using VIM confusing.

What about you

Do you use a different layout for coding? Which layout do you think is best?

Enjoyed the read or have a different perspective?

Let me know on Twitter, Mastodon, or email. 🩵