Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For instance, would Python be a more ergonomic programming language since it doesn't force you to make curly braces which requires the AltGr key. Also Python usually requires less code to achieve the same or am I being biased towards Python and PHP actually is an ergonomical and comfortable language despite forcing the programmer to use the AltGr key? Isn't forcing the programmer to use the AltGr key not very ergonomical?

share|improve this question

closed as unclear what you're asking by GlenH7, MichaelT, Snowman, gnat, durron597 Apr 24 at 13:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

What are you using the Alt key for? –  unholysampler Jan 6 '12 at 2:12
Thanks for the comment! To write {} I must do Alt Gr +7 and Alt Gr +0 which in the long run is physically painful for fingers when done a lot –  Niklas in stockholm Jan 6 '12 at 2:17
Ok, that is not the layout in the US. Which was the first thing I thought about when you asked the question. It would be easier to make a keyboard layout that was programming friendly than the other way around. –  unholysampler Jan 6 '12 at 2:19
Technically, this question should be closed as too localized: It only applies to a few countries like Sweden and Norway which use really weird keyboard layouts. C-:= –  Mike Nakis Jan 6 '12 at 3:03
What is wrong with configuring multiple keyboards layout ! Personnaly I have the English US keyboard for programming, alt-shift to the french keyboard to write to friends and family, alt-shift to the Chinese keyboard to write to collegues and alt-shift again back to English us to continue working. I find this occasionnal alt-shift much more ergonomically than having to remember the ascii code for accented characters. Not to mention Chinese which would be just impossible without changing keyboard layout. –  Newtopian Jan 6 '12 at 5:54

8 Answers 8

No. Characters by themselves are intangible, and therefore cannot be ergonomic or non-ergonomic. What really matters in the end is your environment: your keyboard, IDE or even operating system. It is up to them to bind these arbitrary characters to the coder's physical movements. If they do this inconveniently, then it's their fault.

share|improve this answer
Thanks for being very clear. But you could agree that it's a disadvantage having to use shift and alt keys a lot when it's done and there is another solution such as alternative keyboard layouts that we speak about. –  Niklas in stockholm Jan 6 '12 at 5:21
@Maxpm: actually I would disagree, while you could remap your keyboard to accommodate your programming language/style... this still depend on the number of characters that the programming language requires. The more characters, the more like you are to be needing ALT and SHIFT at some point. –  Matthieu M. Jan 6 '12 at 13:27
@MatthieuM. Good point. –  Maxpm Jan 6 '12 at 14:56

Whether a certain character sequence is comfortable or not depends on many factors:

  • keyboard layout being used
  • physical keyboard (not all keyboards use standard locations for all the keys)
  • text editor
  • personal configuration (shortcuts, macros)
  • coding style

If you are concerned about ergonomics, reading code weighs much heavier than writing code, simply because you spend much more time doing the former than the latter. If anything, a language should be optimized for ergonomic reading.

share|improve this answer

Ergonomic score is relevant at the time of writing.

Reading, maintaining, upgrading, etc which go on for ages after the initial release are all relevant for the whole life of the program. Since these are more important for a good life of a program after it is written first, the language's ergonomic score makes negligible sense, if any.

share|improve this answer
Thanks for a very good answer that tells me that a language actually can have an ergonomic score. I will research more how that is measured since ergonomy is important for good working conditions. –  Niklas in stockholm Jan 6 '12 at 5:20
It might just be easier to get a different keyboard... –  VirtuosiMedia Jan 6 '12 at 5:52
@VirtuosiMedia: Or just remap the current one. I remapped my keyboard's CapsLock key to be a control key, since I often need the control key and never need the CapsLock key. –  TMN Oct 15 '12 at 15:36

I think ergonomics in programming languages are more related with the way people think or read and less related with the way people type.


Ergonomics is subjective in the same way some people prefer an armchair and other people prefer other armchairs. However it's a subjectivity where there are clear patterns, like not too hard, not too soft, not slippery, not sticky, not asphyxiating (even if it is subjective most people like to breathe), etc.

Try to read Brainfuck or Malbolge. Those are fairly good examples of how bad ergonomics can get to be. Python, on the other hand, receives awards from time to time as a good language.

Seriously, ergonomics in programming languages matter a lot, as in any human-machine interface.

share|improve this answer
Ergonomics is subjective, but it is still better to use the keyboard instead of the car pedals for the programming :) –  pepr Oct 15 '12 at 20:37
Yes, that is another quite good example. It's technically possible to use the car pedals to type sequences of ones and zeros, and it's very clear that's not a very usable interface for programming. Thanks for the additional example.■ It's quite easy to see what is not comfortable, about what is best, well, there is quite some disagreement, and a wide variety of programming languages and even paradigms. I'm not an expert and I cannot tell what is best, my personal plan is letting the "natural" evolution do its thing.■ BTW: thanks a lot to those that keep the gears of this evolution running. –  Trylks Oct 17 '12 at 9:26

The ergonomics of a programming language (or lack thereof) are entirely subjective, there is no way to objectively measure them.

Having said that, there's no denying PHP could use some improvement regarding programmer friendliness as it lacks consistency. Some built in functions are lower case with underscores (get_class), some don't have underscores (gettype) and some are camelcased (bindParam). Some search/replace functions take their arguments in the form ($needle, $heystack) whilst for others it's ($heystack, $needle). And PHP constants aren't named in a consistant way. Some are prepended PHP_ and some aren't. (PHP_EOL versus DIRECTORY_SEPARATOR)

As of PHP 5 new additions to the language have tended to be more consistant, so the situation is certainly improving, but PHP still carries a lot of baggage of the past around with it.

share|improve this answer
It also depends from the layout the keyboard being used has, and other variables that are not strictly related to the programming language. –  kiamlaluno Oct 15 '12 at 14:27

This is not a problem with your programming language as such, but with your keyboard layout which has special characters elsewhere than the one used by Americans(which have defined most of the current mainstream languages).

Considered buying a US-ASCII keyboard for programming?

share|improve this answer

Yes. Anything that involves the body can be measured ergonomically, although the final score can change due to different keyboards, etc.

share|improve this answer

Try the following with Python and read the result:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Think about the statements and you may be able to decide if you like it or not. Then you will know whether you would like Python or not. Maybe :)

For me personally, Python is easy to type, it is easy to read. This way it is ergonomical in the sense of input/output related to the progammer.

My objection against Maxpm's answer is that also mentally clear basic abstractions are part of the ergonomy as typing ergonomy will not save my headaches if the language is not understandable from the abstractions point of view.

Once the program becomes complex, you need refactoring, making functions out of the blocks of code (easy in Python with simple editors), you need to split functionality to modules (also easy).

For me Python and C++ are very nice, ergonomic languages (not the APL).

The example of non-ergonomic language for me is SQL. True, you can type it all in lower-case. But then it is unreadable for those who are used to traditional upper-case keywords... When forced to type the keyword in upper-case, or you have to get used to using CapsLock, or your Shift-little fingers will hurt.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.