News for hackers. Stuff that matters.
Re:Go generics may use square brackets [] not parenthesis () by djhaskin987 on Tuesday July 14, 2020 @10:53PM (#23840693)
Programming is almost always conducted in English, even if the application itself as well internationalized and can be used from different languages. Even API documentation is almost always written in English regardless of the country of origin of the author. The only exception I can see to this rule is programs and docs written in China.

Everywhere else, it's reasonable to assume that if you're a programmer, you speak English and likely have an English keyboard. This may not be fair, but it is the state of affairs.

You likely own a US keyboard not only for the parentheses problem, but because of all sorts of English isms throughout all code -- alphanumerics, urls, etc are all in Latin script. It's like German in the field of mathematics in the 19th century.

Re:Go generics may use square brackets [] not parenthesis () by GolDDranks on Tuesday July 14, 2020 @10:59PM (#23840732)
It's reasonable to assume that you speak English, but not so reasonable to assume that you have an English (US or UK, for example) keyboard. Basically all of us have keyboard with Latin letters, that are perfectly up to the task of writing "normal" English, but the seldom used braces and brackets are behind some alt-gr shenanigans.

Yes, they are symbols that are used in many programming languages. No, it's not reasonable to assume that they are easy to type for all of us.

Re:Go generics may use square brackets [] not parenthesis () by dgellow on Tuesday July 14, 2020 @11:42PM (#23841056)
I don’t get your issue with modifiers such as alt-gr. I grew up with a mix of Swiss (swiss qwertz) and French layout (azerty), and have my own custom layout since around 10 years, all of them require to use modifiers just to write my main languages and that hasn’t been an issue since I was a kid. If you use a non US layout it’s very likely that you already use modifiers quite often, I don’t understand why that would become an issue once you start writing code.
Re:Go generics may use square brackets [] not parenthesis () by mantap on Tuesday July 14, 2020 @11:13PM (#23840804)
It is reasonable to assume that anybody writing code is using the US keyboard layout. That is the de facto standard and standards are important.

Anybody who deviates from that is doing so at their own risk. If you want to use Dvorak or Azerty instead of Qwerty then you can do that, it's just not advisable because things like Vim will no longer make sense.

If you try to write code using a layout that doesn't have all the ascii printable symbol characters in accessible locations then you're creating a special kind of hell for yourself. It takes like 30 seconds to change to US layout.

Re:Go generics may use square brackets [] not parenthesis () by dgellow on Tuesday July 14, 2020 @11:34PM (#23840989)
> It is reasonable to assume that anybody writing code is using the US keyboard layout. That is the de facto standard and standards are important.

That’s not reasonable at all. You have way more people writing code outside of the US than within. The US layout may be the most represented one, I don’t know statistics on this, but I would expect it to be on the losing side when comparing US layout vs non-US layout.

Though I would agree that having access to ASCII is something you need, but any standardized keyboard layout in the world can do that via modifiers, if not directly.

Re:Go generics may use square brackets [] not parenthesis () by setr on Wednesday July 15, 2020 @03:21AM (#23842254)
Its reasonable in the sense that the decision was already made, by history & circumstance, and that it's largely not that problematic and well supported (out of necessity).

The only alternatives would be to converge on a lowest common demoninator, and have a likely more inconvenient syntax for all parties, or to diverge into regional-specific dialects, which unicode shows to be.. wide.. and generally make code sharing much harder.

This is really more of a "many mostly equivalent solutions, but one needs to be picked" scenario -- and it would be time poorly spent trying to undo the incumbent solution (and will naturally be rendered untenable by endless bike-shedding anyways). The worst of all solutions -- except for all the others

Re:Go generics may use square brackets [] not parenthesis () by YawningAngel on Wednesday July 15, 2020 @08:17AM (#23844104)
Lots of non-US based programmers use a US layout anyway though, so I think it's a pretty reasonable assumption in the context of English language programming
Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @08:44AM (#23844355)
No, it is not reasonable. While, as you can see, I am fine using English, I have to use a German keyboard layout because otherwise I would lose the ability to type my native language.
Re:Go generics may use square brackets [] not parenthesis () by account42 on Wednesday July 15, 2020 @11:05AM (#23846213)
There is nothing preventing you from swtiching layouts between coding and typing German.
Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @11:10AM (#23846288)
Yes, there is: I am a touch-typist. So the layout of the keyboard is wired into my muscle-memory. Trying to switch layouts wrecks havoc with that. I tried it for a while, when I had to use an English layout at work, and it was very detrimental to my typing abilities. So I had to decide on one layout, and my native tongue won. As you see, I can type English text quite fine, just the brackets are more painful to type than parens.
Re:Go generics may use square brackets [] not parenthesis () by account42 on Thursday July 16, 2020 @04:04AM (#23856848)
How long did you try? Of course learning to touch type on a different layout will take some time but that doesn't make using brackets in programming languages unreasonable.

Using a German layout is very much a choice you have made and is no reason for you to demand that programming languages should make everyone else's life harder to acomodate those choices. Even for German text input, umlauts and sz are rare enough that it is not much of a hindrance to have to enter those via dead keys or compose sequences on a layout that doesn't make {} and [] a pain to type.

Re:Go generics may use square brackets [] not parenthesis () by IceDane on Wednesday July 15, 2020 @12:56PM (#23847986)
I don't think that's reasonable to think at all. Literally no one I know locally that is also a programmer uses the American layout. The difficulties of inputting symbols with ex. altgr is overstated.

I really don't think most people use the American layout. That's just typical america-centric narcissism.

Re:Go generics may use square brackets [] not parenthesis () by alkonaut on Wednesday July 15, 2020 @04:38AM (#23842681)
I speak Swedish and code/message/email in English for work, but I still need to type Swedish occasionally so my keyboard is Swedish both in hardware (layout) and software (mapping).

Curly brackets etc use hand-twisting alt-gr combinations on a Swedish layout so I’d be better off using a US keyboard mapping so I can type ([{ using only shift. I have tried and failed to make that switch. It would probably just slow me down for a month or so before it made me faster, but I’ll keep pushing my square-wheeled cart thank you.

Re:Go generics may use square brackets [] not parenthesis () by rightbyte on Wednesday July 15, 2020 @06:30AM (#23843342)
I have tried too and I gave up. It made my head hurt and you are not really getting the US layout anyway.
Re:Go generics may use square brackets [] not parenthesis () by OskarS on Wednesday July 15, 2020 @07:05AM (#23843583)
I created an Emacs minor mode to make the ö/ä keys type square/curly brackets, but it’s not ideal.
Re:Go generics may use square brackets [] not parenthesis () by sneak on Tuesday July 14, 2020 @11:14PM (#23840811)
Unfortunately this is not the case. Many, many people use laptops, and getting laptops with non-local keyboard layouts is Really Quite Difficult. You usually have to go to the place where the layout is native to buy it.

External keyboards, sure. But many of us are laptop-only.

Sure, you can remap the keys, but also, not everyone is a touch typist.

Re:Go generics may use square brackets [] not parenthesis () by sacado2 on Wednesday July 15, 2020 @05:39AM (#23843028)
Even if your code is written in English, some text still has to be written in your own language (in particular, anything the end user will happen to read). And, although you can write English from a (say) French keyboard, writing French from an English keyboard is a PITA.
Re:Go generics may use square brackets [] not parenthesis () by hocuspocus on Wednesday July 15, 2020 @06:31AM (#23843351)
> writing French from an English keyboard is a PITA.

There's no English keyboard.

Writing French with the US international layout is actually pretty easy.

Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @08:47AM (#23844386)
There are US English and English UK keyboards, both a very similar, and very dissimilar from French and German keyboards. I would challenge you to tell me how you type the following letters "easily" on an US international keyboard: ä ö ü ß.
Re:Go generics may use square brackets [] not parenthesis () by hocuspocus on Wednesday July 15, 2020 @12:09PM (#23847282)
https://en.wikipedia.org/wiki/British_and_American_keyboards...

The umlaut is a dead key so it's very easy. ß is AltGr or Option + S which I admit is a bit more annoying, but your spellchecker should take care of that, no? (I'm Swiss so even when I have to type in broken German, we don't use the ß here).

All layouts are tradeoffs. Not using the US layout makes a lot of things annoying in our field. I write code and use my IDE's keyboard shortcuts more than I need to write long texts in my native language.

Re:Go generics may use square brackets [] not parenthesis () by sacado2 on Wednesday July 15, 2020 @11:05AM (#23846205)
There are many diacritics in French, and not having a key for the most frequent accentuated letters is far from optimal (for instance, the previous sentence in French would contain 5 diacritics).
Re:Go generics may use square brackets [] not parenthesis () by hocuspocus on Wednesday July 15, 2020 @11:49AM (#23846958)
You'll never find an optimal layout, they're all compromises.

I've switched to US intl 15 years ago and I don't type in French any slower than I used to. On the other hand I benefit greatly from using the default layout in our very US-centric field.

Re:Go generics may use square brackets [] not parenthesis () by LandR on Wednesday July 15, 2020 @10:02AM (#23845326)
If I set my layout to US then @ and " swap.

So " is Shift+' and @ is shift+2

In UK keyboard layout, @ is shift+', and " is shift+2 (which is what is shown on my keyboard keys).

Re:Go generics may use square brackets [] not parenthesis () by orthoxerox on Wednesday July 15, 2020 @11:17AM (#23846399)
Can you imagine how Russians and Bulgarians deal with it? Yes, they switch layouts all the time. Write some lines of code in English, switch to Russian or Bulgarian to write comments or reply in Slack.
Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @08:43AM (#23844335)
No, it is not reasonable to assume that people, who are fine at speaking English, are using an English keyboard layout. I am using a German keyboard layout, as I want to be able to use my native language, and that is not possible with an English layout. However, as I am a touch-typist, I cannot switch keyboard layouts frequently, so I have to go with the German one.
Re:Go generics may use square brackets [] not parenthesis () by heavenlyblue on Wednesday July 15, 2020 @08:47AM (#23844391)
I can touch-type in Russian and English layouts.

My favorite keyboard is British up to the point of me specifically picking a laptop/physical keyboard with a British layout.

Just learn both and you'll be OK.

Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @10:04AM (#23845356)
Lucky for you, that you managed to learn to touch type on the different layouts. It might help though, that Russian and English are entirely different layouts. The problem with German and English layouts is, that they are mostly identical, and only about 10% of them differ. This makes it very difficult to master both layouts at the same time. I tried it for a while, when I had to use an English layout temporarily. My experience was, that it thoroughly made my typing worse on both layouts.
Re:Go generics may use square brackets [] not parenthesis () by heavenlyblue on Wednesday July 15, 2020 @10:25AM (#23845607)
I've got friends who used the phonetic version of Russian keyboard where about 80-90% of the letters are going to be similar phonetically. All of them can touch-type by now.

The thing with touch-typing is that you don't think so you have to go through a period of discomfort.

Re:Go generics may use square brackets [] not parenthesis () by _ph_ on Wednesday July 15, 2020 @11:01AM (#23846133)
I am very proficient with touch typing. But in my experience, mixing German and English keyboards erroded my skills considerably.
Re:Go generics may use square brackets [] not parenthesis () by Narishma on Wednesday July 15, 2020 @01:24PM (#23848407)
I regularly switch between American and French layouts. I don't think it's particularly hard.

Edit: If that wasn't clear, I meant that I touch-type on both layouts quite easily.