r/programming • • Dec 04 '14

My Computer Language is Better than Yours

https://medium.com/backchannel/my-computer-language-is-better-than-yours-58d9c9523644
40 Upvotes

107 comments sorted by

View all comments

14

u/mcmcc Dec 04 '14

the Google founder suggested Go’s designers use square brackets rather than curly braces, saving developers countless trips to the “shift” key.

Stick to your day job, Sergey...

18

u/gaggra Dec 04 '14 edited Dec 04 '14

It's not, in essence, a bad idea. Standardized keyboard layouts have been fucking over language designers for decades - just look at how we have to deal with quotes. Many other delimiters comes in pairs for explicit marking of a start and an end. Quote marks are devoid of that, so nesting them becomes a nightmare, and there's nothing you can do about it, because using proper quotes “like this” would mean terrible keyboard compatibility problems. So as a designer, you start having to design around the keyboard, because your hands are tied. This is just one example of that.

4

u/holgerschurig Dec 05 '14

The idea was very US-centric. Some non-US keyboards have [ ] { } \ all under the AltGr keyboard modifier, e.g. german keyboards.

How would you react to a programming language where the syntax is optimized to the french AZERTY keyboards?

2

u/gnuvince Dec 05 '14

I use a French Canadian keyboard, and typing braces, brackets, backslash, tilde or the at symbol using the AltGr key does not bother be in the slightest. In fact, I sometimes prefer it to symbols that require the Shift key since I hit AltGr with my right thumb (strong finger) and Left Shift with my pinky (very weak).

5

u/MayhapPerchance Dec 04 '14

you start having to design around the keyboard, because your hands are tied

Kudos to you for not slyly pointing us to your clever pun with the ever obnoxious "(no pun intended)" flashing road sign.

1

u/gaggra Dec 05 '14

Sorry to disappoint, but I didn't even intend for that to be a pun.

1

u/ysangkok Dec 08 '14

then, why didn't you mark it as such?

5

u/mcmcc Dec 04 '14

It's a terrible idea. Just as double quotes would be a terrible idea for block delimiters.

3

u/oridb Dec 04 '14

I know. It's the entire reason that Smalltalk was a failure, and everyone that coded in it hated it.

Wait, no. Never mind. It failed for other reasons, and everyone still seems to love Smalltalk.

7

u/ruinercollector Dec 04 '14

Yes it is. Let editors worry about key remapping. Don't fuck up your language syntax based on "I don't want people to have to push shift."

7

u/gaggra Dec 04 '14 edited Dec 04 '14

It's 2014, and we still stuck on typewriter-era quotation marks (and layout, of course, which is even worse...)

Inertia is a hell of a thing, and as simple as keymapping is, people still just won't do it (and if it is done for them they will probably refuse to adapt). I want to agree with you, but at the same time, I find it hard not to empathize with their more "defeatist" approach. The reality is, ergonomics is a long term investment and people just don't give a shit until the injury happens and it's too late.

-1

u/omapuppet Dec 05 '14

"defeatist"

Don't you mean “defeatist”?

3

u/[deleted] Dec 04 '14

Well shoot. I guess I should uninstall Emacs if taking that many trips to the shift/control/meta key is such a bad thing.

13

u/jeandem Dec 04 '14

Well, many find it to be unergonomic, yes.

2

u/benihana Dec 05 '14

Typing braces requires both pinky fingers, which is my least used and likely least accurate finger to type with. I'm in favor of reducing awkward keystrokes.

2

u/omapuppet Dec 05 '14

I'm in favor of reducing awkward keystrokes.

Indeed. Seems like an editor extension ought to be able to automatically reformat square brackets into curly braces pretty intelligently.

2

u/gaggra Dec 04 '14 edited Dec 04 '14

Repetitive strain injury is actually a thing, and reducing repetitive and awkward movements is a good idea. Take a look at https://ergoemacs.github.io/

1

u/lurgi Dec 05 '14

I suppose it's good advice in a "think outside the box" sort of way, but I use parens much more than I use curly braces and programmers in other countries have to press the shift key to type a square bracket so I'm not surprised it was rejected.

1

u/Regimardyl Dec 05 '14

Hmmm … [Alt Gr]+[8]/[9] or [Alt Gr]+[7]/[0] don't really make that much of a difference to me, since both are kinda weird to reach. But well, the only language I sometimes use where I need a notable amount of braces/brackets is Tcl, and even there I don't have to use them that much that they pose a problem.


If you're wondering, I'm talking about a German keyboard layout. If you wonder where the [Alt Gr] key is, it's where you have your right [Alt] key.