6 ms·
I started learning programming before I could speak English well. A programming language using English words isn't a barrier in any way. Those words aren't real
by yakubin 6y ago
I started learning programming before I could speak English well. A programming language using English words isn't a barrier in any way. Those words aren't real English words, they are symbols. Instead of "and" you could very well have "/\" and it wouldn't make the slightest difference. As a non-English programmer you don't think of those as words, just symbols. And that's accidentally closer to the truth and probably even moulds your mind into a shape better suited for such an abstract task. Using "if" and "else" neither requires, nor is made easier by knowledge of what those words mean. (At the time when I learnt it, I knew what "if" meant, but not what "else" did. It didn't bother me in the slightest.)
- User23 6y agoI recall reading Dijkstra saying that he preferred that the programming languages he used weren't in his native Dutch for pretty much the reason you give. Presumably the use of Greek letters in traditional mathematics doesn't present an insurmountable barrier to non-Greek speakers.
- e-clinton 6y agoWhile I agree that you learn to treat them as symbols, it certainly elevates the barrier of entry. I know what “while” means in English, so when I’m reading code, there is less of a mental load to interpret that code. As a beginner, if I had to translate “while” or “throw” or “parse”, I’d make learning more difficult.
- mort96 6y agoIt's not that you would translate them though. You don't have to know what "while" means in english to use it. You just learn that the arbitrary symbol "while" is how you repeat something as long as a condition holds. There's not really anything language-specific about that, except that "while" happens to be a word in English with a meaning which somewhat correlates with what the symbol does in the programming language.
- jgwil2 6y agoCounterexample: as a beginner, I think knowing English made "for" harder to understand: for loops in C don't seem to bear much relation to the meaning of "for" in common usage: yes, there is a condition that initiates the loop, but what about the other two statements? For me it was actually something I had to de-program from my brain before I could understand how they actually worked.
- whatshisface 6y agoI think it's rooted in mathematical phrases like "for all x in the set S..."
- jgwil2 6y agoInteresting. I suppose you are probably right, but I would still argue it's confusing and doesn't actually line up with the semantics of the C-style for loop. If it were a language like Python, wherein collections can actually be iterated over with a "for ... in ..." statement, then it might make more sense. But the C for loop just has an initializer, a break condition, and a statement executed between loops, so there's not necessarily a connection to the mathematical notation, even if it's often used to execute some function over a collection.
- whatshisface 6y agoI was curious so I did a bit of historical research. 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-18.0/86000098-516/section-000026445.html https://public.support.unisys.com/aseries/docs/clearpath-mcp... Disclaimer: references to the Hegelian dialectic are for entertainment purposes only.
- dkarl 6y ago"while" describes itself particularly poorly for native English speakers. It implies a duration that continues until a condition changes, but really the condition is only checked at the beginning of every loop. English speakers have to get over the incongruity using a word for a contiguous period of time to indicate repeated checks at distinct points in time.
- nmeofthestate 6y agoJust speaking personally as a native English speaker, I don't remember ever having expended any effort to get over that incongruity.
- dkarl 6y agoI think it's something that only makes sense after the imperative model clicks. There are a lot of different ways that a beginner might think about what code means, and some beginners write code like this: 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.
- Reli_Salazar 6y agoI completely agree, this probably only makes people have to re-learn things when they switch to a more common language, only delaying the process of learning english more and more, when it is something more than necessary, not just for code, also to move around the internet and search for information. I learned english after learning to code and honestly, it was never a problem, as you say, you just learn those words as "symbols" that represent a behavior, nothing more, but, learn different "symbols" and then move on to "standard symbols" such as a while, return, for, etc. will require an extra effort that seems unnecessary to me.
- ModernMech 6y ago> A programming language using English words isn't a barrier in any way. Those words aren't real English words, they are symbols. 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.
- yakubin 6y ago> 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. 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.
- 6y ago
- guenthert 6y agoI made the same experience. The 'language' of a programming language is a red herring in any case. More of a burden is the relevant documentation and on-line resources, which overwhelmingly are in English. 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.
- oaiey 6y agoHmm .. while I agree there is a case for emojis :)
- leephillips 6y agoThe ability to use Greek letters and Unicode symbols in Julia is delightful, because it helps the math in the code to look more like math, and makes the code in general more succinct. It’s optional, but seems to be popular. And Julia is not alone here, but the culture around it has embraced it.
- yellowapple 6y agoOn this note, Perl 6 (or Raku nowadays, I guess) takes IMO the best approach here (and if Julia doesn't already take this approach, it probably should): allowing both fancy Unicode symbols for those who prefer them and equivalent representations in ASCII (a.k.a. "Texas") for those who don't want to have to switch keyboard encodings or look up symbols to copy/paste or setup editor macros just to write code.
- leephillips 6y agoTeX commands are built in to the Julia REPL. Just type \alpha<TAB> and an α appears.
- lizmat 6y ago
- atleta 6y agoSame here. E.g. I remember I had a problem with the proper understanding of AND and OR. But it wasn't because I didn't understand the words, it was because I didn't get the concept at first. 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.
- oscargrouch 6y agoLatin-derived language speaker here (Portuguese). Also by studying other languages it turns out that English is quite good at expressing simple and composable symbols and structure. 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.
- smt1 6y agoThat being said, different languages have different natural "lowerings" from the syntax/semantics to some sort of isomorphism to mathematical logic. There is also the issue with typology of the symbology. Consider for example: https://wy-lang.org/ https://wy-lang.org/