I am curious about whether programming languages in non-English speaking countries such as France, Spain, and Japan have the same syntax as English programming languages?
Yeah, the syntax works the same no matter what language you speak. You can write comments in whatever language you like, but English tends to be the most common language in coding projects.
The syntax of the coding language doesn’t change. A var
is a var
, no matter where it’s written. Some coding languages look more like English than others. The names of variables, comments, and any text being generated can be anything you like, but very often when you look at code written commercially you’ll see that English is disproportionately used. English is currently the de facto “common language” of code, so when there is the possibility that a software project could be international the bias is toward English.
No, programming languages in non-English speaking countries typically use their own syntax due to cultural and linguistic differences. However, they may also borrow syntax from existing English programming languages. For example, some French programming languages such as OCaml are based on the syntax of the popular English language programming language, C.
Huh? OCaml uses English keywords.
The syntax is the same for a programming language no matter what part of the world it is used.
No they don’t, they generally use a common vocabualary based on a combination of
- a constrained set of characters (ASCII) available on all computers
- previous programming languages
- mathematical idioms
Most newer languages support utf8 for defining names of things, often specifically so that, for example, Chinese programmers can use Chinese for naming things. But that doesn’t affect the actual syntax.
A programming language is a symbolic language: not as much as in maths, but still, that’s what it is. The fact they all use English words for the most part, that isn’t really anything but an accident of history. Like Greek letters are used all over the place in maths: doesn’t mean maths is Greek (heh), you don’t use a different maths in Germany than you would in Ghana.
OCAML is not based on C, it’s an ML family language, and there’s nothing specifically “French” about it. There’s nothing specifically “Japanese” about Ruby, or “Swedish” about Erlang, or “Brazilian” about Lua or Elixir, or “Dutch” about Python. Or for that matter there’s nothing “Greek” about Geometry, or “Arabic” about algebra.