4 ms·
Could it be because golang supports unicode identifiers? For non-native English speakers, it must be more difficult to program in ASCII-based languages, right?
by Mr_P 12y ago
Could it be because golang supports unicode identifiers? For non-native English speakers, it must be more difficult to program in ASCII-based languages, right?
- desdiv 12y agoAlmost every non-trivial programming language released after 2000 supports unicode identifiers[0]. Rust, Python, Ruby, C#, Scala, Clojure, just to name a few, all support unicode identifiers. [0] http://rosettacode.org/wiki/Unicode_variable_names http://rosettacode.org/wiki/Unicode_variable_names
- ahoge 12y agoDart doesn't, surprisingly. I don't really mind though. It just means that I can't use non-English identifiers which I shouldn't be using anyways. Non-English identifiers can be quite troublesome in international projects. Even if your project currently isn't, it might be in a few years. It's a maintenance nightmare waiting to happen.
- electrum 12y agoAnd older ones such as Java, released in 1995.
- Gurkenmaster 12y agoPython is actually older than Java and Ruby is roughly as old as Java
- deleted 12y ago[deleted]
- sacado2 12y agoExcept the one implementing hacker news, obviously ;)
- fs111 12y agoso does Java...
- mimighost 12y agoWell...I do want to let you know that in most Chinese colleges, computer science starts from learning C. While using in Chinese in comments might be very common, I rarely seem people using non-English identifier in actual code. If such behavior being caught on sight, I am pretty sure it will be flawed upon and be treated as evidence of being unprofessional.
- edwinyzh 12y agoSpeaking generally, not specific to golang, but no serious programmers will use non-ASCII identifiers. Why? I think the main reason is that it's a hassle to input Chinese characters.
- alfiedotwtf 12y agoYou do know that there are programmers that live outside of English speaking countries that use non-standard US layout right :) http://www.dcothai.com/download/lowkey.gif http://www.dcothai.com/download/lowkey.gif http://upload.wikimedia.org/wikipedia/commons/2/20/Keyboard_layout_Chinese_Traditional.png http://upload.wikimedia.org/wikipedia/commons/2/20/Keyboard_...
- _pmf_ 12y ago> You know that there are programmers that live outside of English countries? I don't think the existence of sentient life outside of the US is common knowledge in Silicon Valley.
- AYBABTME 12y agoI think it's beyond nationalism. Programming is done in english because its the common tongue, and the world in which programmers grow is distributed and quasi-borderless, so there's interest in using a tongue common to all. There's no point in not writing code in english, it's a self defeating endeavor. I'm from a non English speaking nation and I originally used an non-standard US layout, although I changed to US layout when I realized doing otherwise was an exercise in futility.
- hamstergene 12y agoCertainly not for that reason. Actually, as a non-native English speaker, I consider unicode identifiers one of the most useless features for a language. There are reasons why unicode identifiers have never been widely used, and probably will never be, even though they've been around for more than a decade: 1. You're unlikely to be allowed to use them. Unicode identifiers stagger international collaboration. Do you want your Chinese colleague to commit some hieroglyphical identifiers into your code, and then an Arabic colleague to add right-to-left curvatures? I doubt that :) They are unwanted in outsourcing, freelancing, open-source, any company which does foreign hire, they are a problem when asking on StackOverflow, etc. 2. There is just no problem to use English in the first place. Programmers already use English every day. 80-100% of information (documentation, QA, discussion forums) on any programming topic is in English; native-language sources are lacking at best, often nonexistent. If person is a professional programmer, it's way too late for them to have a couple of words translated. 3. They are not as appealing as you might think. Many languages don't work the same way as English. For example, in expression `print(line)` the word `line` may have to have different morphological form than in `var line = ...`, and yet another form for `if '_' in line`; one form for all uses is very unnatural and requires getting used to (and if you're going to adjust anyway, why not adjust to English then). 4. Mixed-language text is simply harder to type when second alphabet is not latin. It's like 3x harder when foreign words need to be inserted. I have even seen colleagues discussing code in chat using English just for that reason. And since at least language keywords and standard libraries are already using English, mixed is what it gonna be. A person must have some real serious trouble with English to tolerate that. Even in strictly local projects where all comments are in native language, unicode identifiers are rarely used. P.S. When I was reading Swift book about unicode identifiers, I immediately thought: "first paragraph of every Swift coding conventions on the planet is going to be, don't use unicode identifiers".
- gurkendoktor 12y agoI agree, but I think we live in an idealist bubble on Hacker News. Some of my freelancing clients maintain a bit of (Unicode free) English-German code. What would you do if you had to write one of the gazillion business software systems we never see here on HN, and you had to codify boring terms like Boolean rightToGiveExtraordinaryNoticeOfTermination (in any other language)? The client/superior has not provided you with an English translation, and your English is mediocre. I can see how non-English code is the least evil in this situation. I have also inherited outsourced code from Russia once and it had Russian (cyrillic) comments above every English identifier, so apparently some people don't mind switching between keyboard layouts while typing :)