I also find it frustrating, when comments or variable/function names are in anything but English. KDE, I look at you (even though I can read German just fine)!
Allowing anything but ASCII in a programming language is just inviting disaster. I'm not looking forward to find Chinese characters in source code ...
Perhaps we'll have some day an automated translation tool for source code, much like we have today for code-beutifiers.
I too prefer having function, variable and keywords in ascii as there is generally little to no ambiguity about what the character is or how it’s typed, but not being able to assign strings meaningful values in source code or add comments with meaningful and readable text for the domain of your program is an unnecessary burden.
The "for" loop comes from ALGOL[0]. In ALGOL, the FOR statement supports syntax like "FOR V:= AEXP1, AEXP2,... DO". That's like the higher-level iterator syntax, except it's assigning V via iteration over a sequence of expressions (AEXP N) that is fixed at compile time. That's the context where FOR makes sense as a term. (Step 1: thesis)
Now, ALGOL also happens to support a FOR-STEP-WHILE format, which works the same way as the C for-loop[0]. That makes less sense from a mathematical nomenclature perspective, but it is justified through analogy to the original FOR definition.
When C, which was based in part on ALGOL, implemented for, it dropped the original meaning and kept the special case meaning because the latter was more useful, being dynamic instead of fixed at compile time. Hence, the for loop. (Step 2: antithesis)
Eventually other languages implemented for with iterators, returning to the original ALGOL meaning of for, but synthesizing it with the dynamism of the C for loop. (Step 3: synthesis)
[0] https://public.support.unisys.com/aseries/docs/clearpath-mcp...
Disclaimer: references to the Hegelian dialectic are for entertainment purposes only.
It was added in C++11 so it looks recent there. But the syntax was in Perl 4 back in 1991. And someone who knows programming history can probably find older examples still in other languages.
while guessing == true:
...
if is _correct(answer):
guessing = false // This stops execution and jumps out of the loop, right?
answer = next_guess()
...
// answer should be correct now
print('Correct answer is %s' % answer)
The program says this block of code executes "while" guessing is true. How does it make sense that code inside the loop is still executing after guessing is set to false? For you and me, since our brains have been molded to the the imperative model of programming (execute this line, then this line, then this line,) we understand that "while guessing == true:" is a line of code that only has effect at specific times, "when the program gets to it." That is not what "while" means in ordinary language, so it's confusing for a beginner until the imperative model is really locked into their heads.Presumably the use of Greek letters in traditional mathematics doesn't present an insurmountable barrier to non-Greek speakers.
Okay, but what about error messages? A good error message tries to convey the nature of the error in a complete sentence or sentence fragment. Comments are often written in English. Documentation is often only available in English. Tooling suffers the same issue. Non English speakers are forced to learn English if they want mastery of the programming language, and this goes beyond mere symbol mappings.
That's a fair point. I think I saw some compilers with translated error messages, which would solve that problem. But it was a long time ago, so I'm not sure. However, that is an issue external to the programming language per se.
> Comments are often written in English. Documentation is often only available in English.
When you get a programming book translated to Polish, comments are going to be written in Polish. Manpages have translations into many languages. As for library documentation, it's long past the point of an introductory programming course.
> Tooling suffers the same issue. Non English speakers are forced to learn English if they want mastery of the programming language, and this goes beyond mere symbol mappings.
True. However, I think it pays off big time. I think a world where people are forced to learn a language that everybody speaks is a much better world than one where different regions of the world have siloed repositories of knowledge, and collaboration can only happen on short distances. I think too often people complain that they need to learn A, in order to do B, even when A dramatically broadens their horizons and lifts the ceiling on what they can achieve. It's similar to the common antipathy towards being required to learn maths, if you want to do game engine programming, physics, etc. Without grasping a good chunk of maths, you're not going to be a good game engine developer or physicist. Same with English. Without it you're not going to be able to efficiently collaborate with others. Documentation is just one instance. There is also the usual asking questions on forums, reading blog posts, research papers. Those things may sound like restrictions to some, when in fact they're the opposite.
GCC has translated error messages and its horrible as it impossible to look up the errors onine and makes the errors useless when you seek support from someone who does not speak your language.
I pissed myself off quite a bit when my logical expression of something like "IF B<50 AND B>100" didn't work. Then my mother, who was also a programmer helped that I indeed needed an OR. I learned it, but it didn't make sense, because that's not what how I would have said it in (any!) natural language.
Later on I've figured out that my misunderstanding was caused by the fact that while I've written "IF B<50 AND B>100" I meant "IF B<50 AND IF B>100", or more precisely "WHEN B<50 AND WHEN B>100".
I also remember the surprise when learning that PEEK and POKE (two keywords in BASIC) actually both mean something and not just made up pair of words.
While i would choose a latin-derived language to write poetry, speech or a novel because the expressivity, at least in those contexts are unparalleled, for clean, honest and even scientific terms, if there's a need for a human language, the english language, at least for me, is what suit those the best.
Apart from that its also a question of chance and historical events.. This sort of tool is great to teach younger kids to program and thinking in programming terms. But just like math, its reduced to a more symbolic level, so the word you are using to define things its not that relevant and giving that property, its a good thing that its more universal, just like in math.