Brackets and international keyboards
Most programming languages use parentheses for grouping subexpressions.
In Aklo, I'm using square brackets for grouping subexpressions, on the grounds that the precious unshifted brackets should be used for开发者_开发技巧 the most common case.
But that's on a US keyboard. Are there any keyboard layouts on which it's actually easier to type parentheses than square brackets? If so, would programmers using such keyboards appreciate the option of using parentheses?
Some keyboard layouts (German and Norwegian for example) require you to use the "Alt Gr"-key (the right alt-key) to access square brackets and curlies. This is somewhat more painful to type then parens because the Alt-Gr key is smaller than shift and isn't conveniently located under your little finger. Also the square brackets are located on the 8 and 9 keys on German keyboards, which is directly above the alt-gr key, so you have to move your hand so that your thumb is on Alt-Gr and the middle finger (or whichever) is on the 8 or the 9.
I find this quite annoying, but I'm also quite used to the fact that programming on German keyboards is a pain.
As far as I know all common keyboard layouts have parens as shift+8/9 or shift+9/0, so it takes the same effort to type them on all layouts, but on some layouts square brackets take more effort.
Well, if you happen to have an old Symbolics Lisp Machine lying around the Lisp Machine keyboard had parentheses unshifted and brackets shifted, but I can't think of any modern keyboards with this property by default.
Some of my emacs-wielding friends swap []
and ()
in their key bindings though.
精彩评论