Hacker News new | ask | show | jobs
by BiteCode_dev 1742 days ago
> It wouldn't be bad at all if programming languages were localizable.

It wouldn't be bad indeed, it would be terrible.

I wouldn't be against some IDE add-ons allowing you to see the keywords in your language if you wish, but the underlying names should stay in english. And the function names as well. Otherwise:

- you duplicate the documentation effort, which is already a burden;

- you make googling things extra hard

- people will use their language features, which means non ascii chars. Good luck typing "La leçon du père noël à l'école de la forêt" with something else than my french keyboard.

- IT is nothing but thousands of conventions glued together. And names are a hell of a shortcut to describe conventions. Break that and you destroy trust, reliability and productivity.

- you split the community. FOSS works so well because we can collaborate so well: we have one rosetta stone that lets us do so. Is has a basic alphabet, few rules, and is quite easy to learn.

I'm a french Python dev, and Python 3 does allow you to write variables names with french accents. I would never do that, and really hope nobody ever does.

3 comments

I'm also a french developer and though i've been very pedantic in the past against non-english code, I must say today that I really prefer "french" well expressed code over "english" code full of errors, "faux amis" everywhere and wrongly expressed intentions.
The kind of code you talk about are usually internal only. People don't write libs, framework or main stream language in those situation.

In that case, then it's ok to bite the bullet, to avoid the worst case scenario. But you are already in a bad place to start with. Because if you put in prod some code by somebody who can't write english properly, then it means your team doesn't have access to most information resources in the world.

So your problem here is damage control, hardly a situation to generalize from.

There’s a lot (maybe a majority where I live) of people who can perfectly read and understand English but not write a single sentence without making errors.
Bad written code is bad written code in any language, that's a false comparison.
What I meant is that the same non English native developer can write totally well expressed code in $native_lang but also full of nonsense code in English.
In that case I'll make an exception, but this is actually very rare. I can see a clear correlation between terrible english and terrible code.
I almost entirely agree, though I think your third point (typing non-ascii characters) could be less severe with one extra lesson in the typing course most kids are forced to take. When I first took French in 7th grade somehow I learned online you could enter ascii codes (whatever those were) on Windows with alt+numpad, and I still have memorized that alt+130 gives é. Later I moved to Linux where we have a great Compose key system, so I can just type <compose> + e + ' and get é, <compose> + c + , to get ç, and so on, with <compose> mapped to whatever I like (currently right-alt). Supposedly (haven't tried it) this system now has a Windows port: https://github.com/samhocevar/wincompose

Asian languages are harder. But if you're told about IME, then at least if you know what you want to type, how to actually type it isn't a big burden. IME can also help with rarer math symbols like ⋂ (\bigcap) ≅ (\cong) or ⊵ (\unrhd), or is another way to get something like the compose key system.

That's a recipe for combinatorial explosion: each language has special chars or even are just made if glyphs, are you going to learn them all? Do you want to impose the burden for all devs in the world?

And now your typing is not at all fluid, even if you didn't have to stop and thing about every single special characters (which most people do), you will have to enter a combination to get them every time completion can't help.

In fact, even with an AZERTY keyboard, typing French, my native language, is slower than english.

Instead of having one simple common ground, you also now have an infinite number of variations to care about.

Not to mention having to understand a lib in spanish, an another one in russian and a last one in Hindi or arab.

I don't need to learn them all, I just need to know the ones I expect I need to type in for the foreseeable future. I might even forget them later (as I've forgotten a lot of LaTeX mappings, fortunately there's a cheat sheet).

You're just repeating your other points about the problems that come from having so many languages, which I mostly agree with, but typing at least is not really an issue, which is all my point is. The issue is: "do I know Arabic?" not "I know Arabic, can I type it?"

As for your experience with French, maybe the AZERTY layout is just inherently bad, but how much slower is it really? Typing your example sentence with my compose key takes me about 3x longer than ignoring the accented characters entirely, which is more than I expected, though I'm very unpracticed. With Japanese, which I'm even more of a noob at, nevertheless the overhead is smaller. If I wanted to type 'purple', I hit a chord to enter JP IME mode if I'm not in it already, type 'murasaki' (the romanized version of the word) at full speed, and leave it as むらさき or select from kanji completions to get 紫 or maybe I needed it to be in katakana so I hit F7, finally I commit it and move on. It may seem like a lot but whatever the case it's a really tiny overhead from just typing 'murasaki'. In practice though looking at source code from Japanese developers I see a mix of full English (maybe some Japanese comments, maybe not), some mix of Japanese but always using romanized symbol names, and full-on variable and function names are in actual Japanese. Because the overhead of typing is so small though, I don't have a preference for the second or third option, they're both fine, though of course selfishly I'd love for the whole world to understand and use English exclusively. For the French case, even with an overhead of 3x in the worst case, I wouldn't object to a variable with an é in it.

I know a lot of devs that don't even type with 5 fingers, you are apparently well trained with your keyboard and you take a X3 hit.
> Good luck typing "La leçon du père noël à l'école de la forêt" with something else than my french keyboard.

There's key bindings for a regular qwerty keyboard that lets you compose letters and symbols to make accents. It's very easy to write French (with all the accents) on a US keyboard (on Gnome Intl. Alt keyboard with dead keys I believe).

French here. I've an American keyboard, not only because my company language is english, but especially because writing code on a US layout is from far the best. [], {}, () can be typed directly or by pressing shift. On a French keyboard, you've the additional Alt-GR key which must be used (second Alt key), which makes some keys awkward to type efficiently - if you've a MacBook, the Alt-Gr key doesn't event exist, which makes writing code a nightmare ([ and { just don't exist!!).

Then, numbers which are very common to type when writing code must be typed by pressing shift. A French keyboard is made to write French efficiently, arguably English too, but definitely not to write code.

Québecois here, for me I have to switch between English and French all the time and pressing Alt do ~{}[] and Shift for <>()| has become a second nature. I just don't think about it anymore and I have to say that when I have to use a US keyboard I just feel so limited.
The problem with US keyboard is that it's most of the time an ANSI layout, with a missing key between Z and left-shift. I love the CSA keyboard because letters with accents are in direct access (a lot better than French Azerty) and {}[]() are positioned logically.
I very much long for a French keyboard designed for coding ...
A French equivalent of the "Polish Hacking keyboard"? Never used it (not even remotely Polish), but I know several people who speak well of it.
I had a computer with an US ANSI keyboard a few years and I don't remember it to be very easy. It's annoying to compose accents, it's worse when you have to switch to another OS or another computer. On Windows, it's a mess when you have more than one keyboard layout activated. And it's terrible when you have to type « » or æ œ like : « J'ai mangé des œufs pour Noël »
I just set the input language to French and let autocorrect add the accents, 99% of the time, it gets it right as there are not that many words where the accents change a word into a completely different word. The only one I can think of is marche as in walking vs marché as in a market.
Easy doesn't mean productive. My guess is that you take 2 to 3 times longer to time such sentence.
Versus using an azerty keyboard or another French-specific layout? Yeah, it's a tad slower. But it's a hell of a lot quicker than trying to look up/remember alt-codes or something. Writing in 2 languages with one keyboard is never going to be optimal.

And 2-3 times longer? Most sentences in French don't have that many accents, the example picked was a rare one.

Yes but we are talking about putting them in code symbols in the first place.
French here using US keyboard with Compose key. Works like a charm.