News for hackers. Stuff that matters.
Re:Why do programming languages use curly braces? by dlitvakb on Tuesday February 26, 2013 @10:36AM (#5286155)
Most programmers often write their programs in english anyway, to be easy to share or to review by others (even in closed source software), so it makes sense for programming languages to mostly care about English keyboard layouts.

Anyways, if the keyboard layout is a blocking problem for you, consider changing it to what it suits you the best, or use multiple layouts for different tasks. Every operating system has a keystroke to swap layouts.

Re:Why do programming languages use curly braces? by buster on Tuesday February 26, 2013 @11:06AM (#5286349)
It's not about writing english per se. How often do you need to write {[]}<> in a letter?

Those keys are really easy on US layout but horrible to type on a german keyboard layout. Holding alt-gr and press 7 or 8 or 9 or 0 is surely not impossible to type but compared to US layout it's much more worse, imo.

Fortunately Python does away with the overabundance of curly braces at least.

Re:Why do programming languages use curly braces? by TylerE on Tuesday February 26, 2013 @11:18AM (#5286452)
Why is Alt+9/0 so much worse than Shift+[/]

slightly worse I'll grant, but MUCH worse?

Re:Why do programming languages use curly braces? by ygra on Tuesday February 26, 2013 @11:35AM (#5286590)
It's AltGr, which is on the right side. And that makes it quite awkward to use. I either break half my hand or need both hands. Or resort to Ctrl+Alt on the left side which isn't optimal either ...
Re:Why do programming languages use curly braces? by buster on Tuesday February 26, 2013 @12:16PM (#5286894)
Wow.. now i'm wondering how quickly (if ever) i can adopt to using ctrl+alt instead of that awkward (and hated) AltGr. You never stop learning...
Re:Why do programming languages use curly braces? by TylerE on Tuesday February 26, 2013 @01:09PM (#5287246)
Couldn't you remap your keys so normal (left) Alt is AltGr and right Alt is "normal" Alt? Alt key bindings are pretty rare.
Re:Why do programming languages use curly braces? by ygra on Wednesday February 27, 2013 @03:15AM (#5291260)
They are? Every time I want to access a menu or a control in a dialog by keyboard I need Alt. Also in Far Alt+typing searches which I use frequently to get around the file system. Sure, one could get used to doing that with the other hand, but at least for me it's not that little muscle memory that has to be retrained.
Re:Why do programming languages use curly braces? by TylerE on Wednesday February 27, 2013 @10:10AM (#5292684)
Really? Every program I've ever used uses Ctrl as the primary modifier.
Re:Why do programming languages use curly braces? by ygra on Thursday February 28, 2013 @03:34AM (#5297731)
Shortcuts, yes. Access keys, no.
Re:Why do programming languages use curly braces? by gebe on Tuesday February 26, 2013 @11:41AM (#5286643)
It's AltGr+7/0 though (on german and swedish layouts at least), which is much worse. Open curly brace is a killer if you are doing it with one hand only. Also the AltGr button is only represented on the right side of the keyboard while you get the Shift on both sides, which makes it more awkward to use with two hands in some situations.

edit: Wow, just learned that Ctrl+Alt is the same as AltGr from the comment below. I've only used computers daily for 21 years ...

Re:Why do programming languages use curly braces? by IvarTJ on Tuesday February 26, 2013 @11:39AM (#5286623)
Slightly times a lifetime.
Re:Why do programming languages use curly braces? by jonascopenhagen on Tuesday February 26, 2013 @11:53AM (#5286721)
I write software in English, sure, but my keyboard layout needs to be Danish in order for me to write emails, etc. in Danish. Having to swap keyboard layouts would mean I'd be confused constantly.

On a Danish Mac keyboard the curly braces are written by holding down Alt + Shift + 8. Not exactly an easy combination to hit.

> Most programmers often write their programs in english anyway

I'm not so sure about that. There are tons of places where English proficiency is really low, even among programmers.

Re:Why do programming languages use curly braces? by tbe on Wednesday February 27, 2013 @02:12AM (#5291093)
I write norwegian on a US MacBook just fine. All the weird characters are available by pressing the Option key.

When I first got the laptop I switched layouts between coding and writing mails, but after a while I found that learning the key combos for a few letters was easier for me than switching between completely different layouts.

Re:Why do programming languages use curly braces? by camus on Tuesday February 26, 2013 @11:49AM (#5286698)
it is one thing write programs in english , i have a french keyboard , typing english is fine , the problem is all the non word stuff that are not directly visible on my keyboard like {}[]|\] and so on. You kind of get used to it but frankly i dream of a language with non of these characters, just words. typing def/end doesnt bother me. By the way , that's kind of why i love coffee-script so much.

    myObject = 
       param1 : foo
       param2 : bar
       param3 : baz

    foo bar,baz,boom
my god it is a relief on a non english keyboard... on the mac i get the @attr without using alt-right , that is neat.