Coding is English?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Prelates, Moderators General

Coding is English?

Postby Dopefish » Tue Mar 27, 2012 4:22 am UTC

It's recently occured to me that every programming language I know or have seen seems to be, in effect, English. Much of it is it's own little language of semicolons, numbers, arbitrarily named variables, and parentheses, but there also things like "for", "while", "if", and the data types are things like "int[eger]", "string", "double", which are all English words.

Is this simply a by-product of me living in an English speaking part of the world and typically only visiting English sites, and so only being exposed to code written in an English way, or this globally the case? Come to think of it, is all code written from left to right, or are there programming languages written right to left or up-down that would be more popular in regions where that is the normal writing style?

I've typically thought of a given programming language as being it's own "language" in a similar manner to math essentially being a self contained language of symbols, but I'm not so sure now. Could one for example write C++ code in german, and instead of having while(), have <insert german word for while here>() in their code, so that a given programming language comes in multiple languages, or is a given programming language strictly in just one language, and if it's not one you speak you should learn a different programming language that is in your language?
User avatar
Dopefish
 
Posts: 801
Joined: Sun Sep 20, 2009 5:46 am UTC
Location: The Well of Wishes

Re: Coding is English?

Postby Sagekilla » Tue Mar 27, 2012 4:30 am UTC

Are you talking about ENGLISH?.

I kid. Apparently, English is the "lingua franca" of computing.

See also: Non-english based programming languages:


To be honest, I have no idea why English is the predominant language used. I'd imagine it may have something to do with the origins of computing.
The biggest benefit I see in having English as a commonly accepted "standard" language is that it's extremely easy for different programmers to
read the same code and understand what it does.

If everyone coded in their native language, it would be hugely difficult for someone from one country to read the code from someone from another
country. Having a common ground, at least across most programming languages, levels the playing field so that we can communicate in a way
that everyone understands.

I mean seriously, would you want to ask your German friend "Hey can you send me the code to do XYZ?" and have him return something that's filled
with comments and keywords that were in a language you may not understand?
Last edited by Sagekilla on Tue Mar 27, 2012 4:34 am UTC, edited 1 time in total.
http://en.wikipedia.org/wiki/DSV_Alvin#Sinking wrote:Researchers found a cheese sandwich which exhibited no visible signs of decomposition, and was in fact eaten.
Sagekilla
 
Posts: 385
Joined: Fri Aug 21, 2009 1:02 am UTC
Location: Long Island, NY

Re: Coding is English?

Postby Thesh » Tue Mar 27, 2012 4:34 am UTC

There are a handful of non-English languages (can't name a single one off the top of my head), but all major languages are English based.

It's mainly because the first major high level programming languages (FORTRAN, COBOL, and Lisp) were all created by Americans. Pretty much all future programming languages were influenced by those three.
Big are getting bigger and hearts are getting harder, an imaginary game
eating at every living thing, a voice dripping with sarcasm like a bloody fat slash
grinning over bleached white-fang teeth that glow like green warning signs of sickness.
User avatar
Thesh
Has the Brain Worms, In Case You Forgot.
 
Posts: 3645
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: California, Southern USA

Re: Coding is English?

Postby ahammel » Tue Mar 27, 2012 4:40 am UTC

Well, there are these. Edit: ninja'd several times.

Even a native English speaker has to translate the concept of "while" in C code into something like "check if the condition returns something that isn't a zero, execute the code in the block and then take it from the top". That has only a passing similarity to the concept of "while" in English, so I don't know how much cognitive load it would add if, instead of "while", the keyword was "grest" or something. I imagine it would be much harder if you had to learn a new alphabet as well.

Maybe I'll fool around with one of the non-English based languages when I have some time. Might be a fun exercise.
I also answer to 'Alex'

YES, IT'S SPACEY-WACEY!
User avatar
ahammel
My Little Cabbage
 
Posts: 1520
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC

Re: Coding is English?

Postby Bharrata » Tue Mar 27, 2012 5:18 am UTC

Well if you get down to it, machine language and binary are universal languages...but yes, I think it's mostly a by-product of the origins of the inventors, as others have pointed out.
Bharrata
 
Posts: 233
Joined: Sun May 15, 2011 7:57 pm UTC

Re: Coding is English?

Postby Proginoskes » Tue Mar 27, 2012 6:45 am UTC

'scanf("%s",xpr);' looks like English to you?

(Thank you, Usenet Oracle ...)
User avatar
Proginoskes
 
Posts: 309
Joined: Mon Nov 14, 2011 7:07 am UTC
Location: Sitting Down

Re: Coding is English?

Postby phlip » Tue Mar 27, 2012 7:02 am UTC

"scan" and "formatted" are English words, though, and the function name is based on those. And that "s" is short for "string", another English word. Your "xpr" may or may not be based on English words, it's hard to tell from this snippet, but it's not a part of the language proper.

It's definitely more "English" than, say, to invent an example:
Code: Select all
εξετάζωσ("%σ", δσει);
being roughly the Google-Translate-and-Wiktionary Greek version of
Code: Select all
scanf("%s", pstr);

From the Greek "εξετάζω" ("exetázo"; "scan, examine, go over"), "σχήμα" ("schíma"; "format, shape"), "σειρά" ("seirá"; "series, string") and "δείκτης" ("deíktis"; "indicator, pointer"), which are probably grammatically incorrect, but the best individual fits I could find with Google Translate or WT.
While no one overhear you quickly tell me not cow cow.
but how about watch phone?
User avatar
phlip
Restorer of Worlds
 
Posts: 7172
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

Re: Coding is English?

Postby starslayer » Tue Mar 27, 2012 3:25 pm UTC

ahammel wrote:Even a native English speaker has to translate the concept of "while" in C code into something like "check if the condition returns something that isn't a zero, execute the code in the block and then take it from the top". That has only a passing similarity to the concept of "while" in English, so I don't know how much cognitive load it would add if, instead of "while", the keyword was "grest" or something. I imagine it would be much harder if you had to learn a new alphabet as well.
Look at it from the point of view of what the code on its face says you're doing. If I read a while loop in code, for example, I see "while this condition is satisfied, do this." I imagine that's where they got their name.
starslayer
 
Posts: 239
Joined: Wed Dec 02, 2009 9:58 am UTC

Re: Coding is English?

Postby ahammel » Tue Mar 27, 2012 4:39 pm UTC

starslayer wrote:
ahammel wrote:Even a native English speaker has to translate the concept of "while" in C code into something like "check if the condition returns something that isn't a zero, execute the code in the block and then take it from the top". That has only a passing similarity to the concept of "while" in English, so I don't know how much cognitive load it would add if, instead of "while", the keyword was "grest" or something. I imagine it would be much harder if you had to learn a new alphabet as well.
Look at it from the point of view of what the code on its face says you're doing. If I read a while loop in code, for example, I see "while this condition is satisfied, do this." I imagine that's where they got their name.

Right, but the English sentence "while this condition is satisfied, do this" is highly ambiguous. I know that it means "check the condition before starting the loop, and every time a loop terminates", but I had to learn that. A novice coder could easily think that it means "check the condition after every line" or "check the condition continually" or "do this block of code once, unless the condition stops being true", and that's not even getting into what it means for a condition to be satisfied.

My point is that the while keyword isn't really a description of what the code does, it's just a mnemonic. If the language used grest as a keyword instead, I'd have to do without that particular memory aide, but I'm sure that, with practise, I'd just mentally translate grest into my mental model of how while-loops work the same way that I do now when I see a while.

There are plenty of analogous situations in computing, now that I think of it. The Lisp commands car and cdr have their origins in English phrases, but I'm sure most Lisp hackers are perfectly happy to use them without knowing what the phrases are. Unix users grep and cat away with no problems, and how many people could figure out what those do just from the name?

I think it would certainly be more difficult to learn to code in a language that used exclusively non-English keywords, but not so difficult as to require that I actually know any of the language, is what I'm getting at.

[/ramble]
I also answer to 'Alex'

YES, IT'S SPACEY-WACEY!
User avatar
ahammel
My Little Cabbage
 
Posts: 1520
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC

Re: Coding is English?

Postby EvanED » Tue Mar 27, 2012 4:48 pm UTC

ahammel wrote:Unix users grep and cat away with no problems, and how many people could figure out what those do just from the name?

Are you sure about that? How many people get intimidated by the command line in part due to opaque command names like that, and decide not to learn it?

I doubt it's many, but I also doubt it's zero...
EvanED
 
Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Coding is English?

Postby Xanthir » Tue Mar 27, 2012 8:52 pm UTC

ahammel wrote:There are plenty of analogous situations in computing, now that I think of it. The Lisp commands car and cdr have their origins in English phrases, but I'm sure most Lisp hackers are perfectly happy to use them without knowing what the phrases are.

There's a reason CL, at least (probably other Lisps, too) defined FIRST and REST, which are just synonyms for CAR and CDR.

(The English phrases that CAR and CDR came from are opaque at this point, too - "contents of address register" and "contents of decrement register". They refer to the architecture of some old machines Lisp was developed on, where cons cells were stuffed into the memory in a weird way.)
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4310
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Coding is English?

Postby jendral_hxr » Tue Mar 27, 2012 9:50 pm UTC

Proginoskes wrote:'scanf("%s",xpr);' looks like English to you?

"Scan characters (from stdin) using the following formatted string, then put them to this pointer" seems a legit English sentence to me.

To me it's (always) English, though some are machine-like English (MOV, anyone?) They just employ different abbreviation, symbols and names. Like cat (concatenate) and grep (grab regular expression). I haven't tried any non-English programming language (which mostly is just being locally-translated), but if I were to have gcc with Bahasa Indonesia, I'd rather pass.

Brainfuck?
I wish I weren't so stupid
User avatar
jendral_hxr
 
Posts: 44
Joined: Wed Jan 21, 2009 1:57 am UTC

Re: Coding is English?

Postby maafy6 » Wed Mar 28, 2012 12:43 am UTC

Same reason why we own the moon - we Americans got there first.

Spoiler:
Tongue in cheek, people. Tongue in cheek.


Even outside of the keywords of a language, it seems relatively widespread (though naturally less likely) that non-English speakers will code everything else in English as well. e.g. you're more likely to see a German speaking programmer write this:

Code: Select all
void fillWithCake(Mouth *mouth, Cake *cake)
{
    while (!mouth->isFull()) {
        mouth->insert(cake->getNextPiece()); // assume everlasting cake
    }
}


than this

Code: Select all
void fuellenMitKuchen(Muend *muend, Kuchen *kuchen)
{
    while (!muend->istVoll()) {
        muend->einfuegen(kuchen->beckommenNaechsteStueck()); // der Kuchen ist ewig
    }
}


Spoiler:
Also, I don't speak German, so Google translate is to blame for everything. As a side note, when translating "insert into table" from English to German, you get back "INSERT INTO table" - so apparently SQL is English wherever you are


This is more anecdotal than anything, and I have also seen English code mixed with other language comments, but more often than not, if it's getting published on a website or social coding hub or whatnot, it's more than likely going to be English, even if it's not the coder's first language. Maybe because in German, it's because it's more difficult to tell the difference between one long-ass run-on word and a smashed together function name, but that's beside the point. :)
maafy6
 
Posts: 102
Joined: Wed Aug 22, 2007 10:43 pm UTC

Re: Coding is English?

Postby Jplus » Wed Mar 28, 2012 10:18 am UTC

maafy6 wrote:Same reason why we own the moon - we Americans got there first.

I know it's tongue in cheek, but for general interest I'd like to point out that in this case, the Americans were not first.
Feel free to call me Julian. J+ is just an abbreviation.
Image coding and xkcd combined
User avatar
Jplus
 
Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

Re: Coding is English?

Postby Proginoskes » Thu Mar 29, 2012 8:30 am UTC

Jplus wrote:
maafy6 wrote:Same reason why we own the moon - we Americans got there first.

I know it's tongue in cheek, but for general interest I'd like to point out that in this case, the Americans were not first.


Maybe the first to actually use the idea, though ...

As to Plankalkuel ... Where can I get a manual? I have another book to add to my computer-language collection! 8-)
User avatar
Proginoskes
 
Posts: 309
Joined: Mon Nov 14, 2011 7:07 am UTC
Location: Sitting Down

Re: Coding is English?

Postby Sagekilla » Fri Mar 30, 2012 2:42 am UTC

maafy6 wrote:
Code: Select all
void fillWithCake(Mouth *mouth, Cake *cake)
{
    while (!mouth->isFull()) {
        mouth->insert(cake->getNextPiece()); // assume everlasting cake
    }
}


than this

Code: Select all
void fuellenMitKuchen(Muend *muend, Kuchen *kuchen)
{
    while (!muend->istVoll()) {
        muend->einfuegen(kuchen->beckommenNaechsteStueck()); // der Kuchen ist ewig
    }
}



It should be noted that people frequently use descriptive words in their program. Sure, you have car, cdr, grep, etc.

Most of those are from the early days of computing. If you look at newer languages (e.g. C#) you'll find stuff like:

Code: Select all
public ActionResult Login(LoginViewModel model, String returnUrl)
{
   if (ModelState.IsValid)
   {
      if (Accounts.Login(model))
      {
         if (Roles.IsUserInRole(model.Username, "Admin"))
            Info.Log("Admin logged in");

         if (Url.IsValidUrl(returnUrl))
            return Redirect(returnUrl);
         else
            return RedirectToAction("Index", "Home");
      }

      else
         ModelState.AddModelError("", "The username or password provided is incorrect");
   }

   return View(model);
}


(Above code, with certain pieces removed, taken directly from a project I'm working on).

Take a look at the Base Class Library included with C#, or the Java Class Library. The names there
read like "OutOfMemoryException", "StreamWriter", "StringBuilder", etc.

There' some argument to be made that a lot of the syntax from early computing days was terse
due to limitations in hardware. You don't really see it as much when you develop in C# or Java,
both of which are exceedingly common.


If you want a programming language that's really language independent -- Take a look at APL.
http://en.wikipedia.org/wiki/DSV_Alvin#Sinking wrote:Researchers found a cheese sandwich which exhibited no visible signs of decomposition, and was in fact eaten.
Sagekilla
 
Posts: 385
Joined: Fri Aug 21, 2009 1:02 am UTC
Location: Long Island, NY

Re: Coding is English?

Postby mfb » Fri Mar 30, 2012 12:58 pm UTC

Most scientific publications are in english. Why? Because this is a language many (and all scientists) can understand. And the best reason to publish something is to get others reading it.
It would be easy to use german words for "while", "if" and so on - compared to the time you need to learn how to use these structures, learning the words is easy. But if you write comments and similar stuff in english anyway, it is convenient to use english words for programming structures, too.

Some fixes for the cake example, and the login with german keywords:
Spoiler:
Code: Select all
void fuelleMitKuchen(Mund *mund, Kuchen *kuchen)
{
    while (!mund->istVoll()) {
        mund->einfuegen(kuchen->HoleNaechstesStueck()); // der Kuchen ist endlos
    }
}


Code: Select all
oeffentlich HandlungsErgebnis Login(LoginViewModel model, Zeichenkette returnUrl)
{
   falls (ModelState.IsValid)
   {
      falls (Accounts.Login(model))
      {
         falls (Roles.IsUserInRole(model.Username, "Admin"))
            Info.Log("Admin logged in");

         falls (Url.IsValidUrl(returnUrl))
            rueckgabe Redirect(returnUrl);
         sonst
            rueckgabe RedirectToAction("Index", "Home");
      }

      sonst
         ModelState.AddModelError("", "The username or password provided is incorrect");
   }

   rueckgabe View(model);
}


>> Even outside of the keywords of a language, it seems relatively widespread (though naturally less likely) that non-English speakers will code everything else in English as well.
That is right. Comments might be in other languages (especially if it is known that the code is not re-used anywhere else), but even there english is quite frequent.
mfb
 
Posts: 838
Joined: Thu Jan 08, 2009 7:48 pm UTC

Re: Coding is English?

Postby sourmìlk » Fri Mar 30, 2012 8:06 pm UTC

Because the universe smiles upon me. English is used as an international language for a lot of things (it's the second most commonly spoken language, behind Mandarin Chinese), and that's very convenient for me, because I only speak English.
Terry Pratchett wrote:The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
User avatar
sourmìlk
If I can't complain, can I at least express my fear?
 
Posts: 6407
Joined: Mon Dec 22, 2008 10:53 pm UTC
Location: permanently in the wrong

Re: Coding is English?

Postby Dopefish » Sat Mar 31, 2012 1:43 am UTC

Indeed, it is rather convenient for native English speakers, but I've always been uncomfortable with the idea that theres something special about (spoken) language <x> so nonspeakers of <x> will just have to deal with it and learn <x>.

The fact that non-English people typically code and furthermore comment in English comes as a bit of a surprise, since it means they really do need to essentially learn the language to at least a functional level, even if they're not fluent. If I had to learn to code with foreign keywords, that might be doable, but I'd just be figuring out what symbol/sequence of symbols gives me the expected behaviour (e.g. a while loop, or an if statement), and memorising that, rather then actually learning the language, and go on using english comments/variable names. Actually learning a language would be too big a barrier for me (as a monolingual) I think.

English is pretty common to the extent of being a second/third language people are still taught and expected to at least semi-know in countries where it isn't the primary language, so sure in that case using English is apt to be the better choice. In countries where English isn't spoken at all though, are those groups expected to learn English just to code (and/or be scientists)? I'd generally assumed that all the code/academic stuff I've read was in English was because I was looking for such, but if you were in china and spoke mandarin you'd have just as many papers/code available to you in mandarin, and hence there would be no more incentive to learn English then there is for English speakers to learn Mandarin. Is this not the case?
User avatar
Dopefish
 
Posts: 801
Joined: Sun Sep 20, 2009 5:46 am UTC
Location: The Well of Wishes

Re: Coding is English?

Postby Shivahn » Sat Mar 31, 2012 2:14 am UTC

Dopefish wrote:I'd generally assumed that all the code/academic stuff I've read was in English was because I was looking for such, but if you were in china and spoke mandarin you'd have just as many papers/code available to you in mandarin, and hence there would be no more incentive to learn English then there is for English speakers to learn Mandarin. Is this not the case?

That is not the case. You'd have many papers available in Mandarin, but English is the lingua franca of science, so most would still be English.

I was initially going to say that it wasn't like you had to learn too much English to code (e.g., "int x=15;" is not something that takes orders of magnitude more effort for a Russian coder to use than an English one), but then I saw people talking about exceptions and such and realized that for a lot of stuff, it does kind of suck if you don't speak English.

So thanks, thread! I had thoughts because of you.
User avatar
Shivahn
 
Posts: 2193
Joined: Tue Jan 06, 2009 6:17 am UTC

Re: Coding is English?

Postby Xeio » Sat Mar 31, 2012 2:48 am UTC

Shivahn wrote:I was initially going to say that it wasn't like you had to learn too much English to code (e.g., "int x=15;" is not something that takes orders of magnitude more effort for a Russian coder to use than an English one), but then I saw people talking about exceptions and such and realized that for a lot of stuff, it does kind of suck if you don't speak English.
Not to mention all the standard libraries and associated documentation.
User avatar
Xeio
Friends, Faidites, Countrymen
 
Posts: 4783
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\

Re: Coding is English?

Postby Jplus » Sat Mar 31, 2012 10:58 am UTC

Dopefish wrote:Indeed, it is rather convenient for native English speakers, but I've always been uncomfortable with the idea that theres something special about (spoken) language <x> so nonspeakers of <x> will just have to deal with it and learn <x>.

The fact that non-English people typically code and furthermore comment in English comes as a bit of a surprise, since it means they really do need to essentially learn the language to at least a functional level, even if they're not fluent. If I had to learn to code with foreign keywords, that might be doable, but I'd just be figuring out what symbol/sequence of symbols gives me the expected behaviour (e.g. a while loop, or an if statement), and memorising that, rather then actually learning the language, and go on using english comments/variable names. Actually learning a language would be too big a barrier for me (as a monolingual) I think.

Yeah, you're kind of in a luxury position living in a country where nearly everyone speaks English as their mother tongue. It might come as a surprise to you that most people in the world are actually multilingual. Even when they don't plan to do science or programming, many people in the world learn English as a second language in secondary school. Even if they don't learn English, there's usually some other second language that they have to learn. Often, they have to learn more than one foreign language.

It will change though. At some point in the upcoming century English native speakers will probably have to learn Putonghua (=standard Mandarin Chinese) in school. ;)
Feel free to call me Julian. J+ is just an abbreviation.
Image coding and xkcd combined
User avatar
Jplus
 
Posts: 1554
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

Re: Coding is English?

Postby mfb » Sat Mar 31, 2012 4:08 pm UTC

>> In countries where English isn't spoken at all though, are those groups expected to learn English just to code (and/or be scientists)?
I don't know about coding (probably you can do everything in your native language, but documentation in other languages than english can suck), but if you want to do anything interesting* in science: Learn english, at least enough to understand other papers.

Is there any poll about native languages of users here?

>> I'd generally assumed that all the code/academic stuff I've read was in English was because I was looking for such, but if you were in china and spoke mandarin you'd have just as many papers/code available to you in mandarin, and hence there would be no more incentive to learn English then there is for English speakers to learn Mandarin. Is this not the case?
Simple example: Nearly everything in high-energy physics is on arxiv - in english. There is no reason to write the same paper in multiple languages. On conferences, in international collaborations and so on, you have to find a single language anyway.
High-energy physics is not representative in this way, as nearly all collaborations are international today, but the trend is present in other fields, too.


*or at least what I consider interesting. Some test with 20 persons which finds a correlation between age and apple consumption might be funny, and you can publish it in whatever language you want, but nobody will repeat it, or make a similar study based on this test results, unless there is some good reason to look at this correlation which I don't know of.
mfb
 
Posts: 838
Joined: Thu Jan 08, 2009 7:48 pm UTC

Re: Coding is English?

Postby not baby Newt » Sat Mar 31, 2012 5:12 pm UTC

There was an older excel version (possibly works nowadays?). The basic cell function keywords (not sure macro is an appropriate word) were localized. Stored in the localized form in the xls file. Tried to open an English excel file, it complained that IF() was no valid function name.

This was sad.
not baby Newt
 
Posts: 109
Joined: Wed Feb 03, 2010 11:30 pm UTC

Re: Coding is English?

Postby ryan7113 » Thu Apr 05, 2012 4:12 am UTC

I don't know about you guys, but I wrote a module (I use python) that makes all of the functions into different words. print() is now banana(), input() is now dinosaur(), etc. I'm not sure about different languages, but it sure makes coding a lot more fun.
Standard. Because we use it. Goddamn do we have balls.
User avatar
ryan7113
 
Posts: 15
Joined: Tue May 31, 2011 5:11 am UTC

Re: Coding is English?

Postby ahammel » Thu Apr 05, 2012 4:29 am UTC

ryan7113 wrote:I don't know about you guys, but I wrote a module (I use python) that makes all of the functions into different words. print() is now banana(), input() is now dinosaur(), etc. I'm not sure about different languages, but it sure makes coding a lot more fun.

Care to share? Sounds like fun.
I also answer to 'Alex'

YES, IT'S SPACEY-WACEY!
User avatar
ahammel
My Little Cabbage
 
Posts: 1520
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC

Re: Coding is English?

Postby Proginoskes » Thu Apr 05, 2012 6:58 am UTC

There is a COBOL-like programming language called Chef, where code looks like recipes. (I thought of this when I saw your banana() function.)

Or you could avoid words all together and go for Piet, where programs look like Mondrian's paintings ("squares").
User avatar
Proginoskes
 
Posts: 309
Joined: Mon Nov 14, 2011 7:07 am UTC
Location: Sitting Down

Re: Coding is English?

Postby lalop » Mon Apr 09, 2012 11:30 am UTC

ahammel wrote:Right, but the English sentence "while this condition is satisfied, do this" is highly ambiguous. I know that it means "check the condition before starting the loop, and every time a loop terminates", but I had to learn that. A novice coder could easily think that it means "check the condition after every line" or "check the condition continually" or "do this block of code once, unless the condition stops being true"


So long as the novice coder has seen blocks before (if statement) and has the basic intuition that programs are [usually] read top-to-bottom, I find the former two (whatever "continually" may mean) unlikely. The latter just doesn't make sense, especially if the condition is up top. If the condition isn't true in the first place, why would "while the condition is true, do this" result in an execution? If anything, the do-whiles are more ambiguous.
lalop
 
Posts: 204
Joined: Mon May 23, 2011 5:29 pm UTC

Re: Coding is English?

Postby eskarel » Wed Apr 18, 2012 1:31 pm UTC

Strictly speaking, coding is not English, coding is a bunch of words with certain meanings which happen to also be words in English with related meanings.

This may seem like an issue of semantics, but it's not. You could create a language which used any arbitrary character string to represent the keyword foreach, it could be a word in another language, it could be a completely random sequence of letters, it really doesn't matter. What is important is that the same string is used in every program written in that language so that every programmer and more importantly the compiler can understand what you mean. You don't have to understand what the words for and each mean to understand what foreach does, you simply need documentation for that word in your native language and a keyboard which can produce that word. Knowing English makes learning to program easier, but it isn't actually necessary to program if good documentation has been produced.

As for why most languages are English? That's mostly a historic thing, but realistically what other language would you choose? More people speak English than any other language on earth(http://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers), and the next most common language is pictographic and so a poor choice. Sure you could be fair to everyone and make up nonsense words, but that would be silly.
eskarel
 
Posts: 7
Joined: Mon Oct 15, 2007 8:40 am UTC

Re: Coding is English?

Postby mfb » Wed Apr 18, 2012 4:30 pm UTC

Coding is not only "if", "function", "for" and so on. As mentioned before, variable names and even comments are usually english, too.
mfb
 
Posts: 838
Joined: Thu Jan 08, 2009 7:48 pm UTC

Re: Coding is English?

Postby You, sir, name? » Wed Apr 18, 2012 10:31 pm UTC

Most tokens may have English names, but you don't need to understand English to use them. Heck, I was writing programs in BASIC when I was 8 years old, and didn't understand a world of English.
I now occasionally update my rarely-updated blog.

I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.
User avatar
You, sir, name?
 
Posts: 6539
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City

Re: Coding is English?

Postby RAKtheUndead » Fri Apr 20, 2012 9:24 pm UTC

I reckon that there are quite a few reasons, some of them involving historical inertia, others involving actual technical advantages, why English is the primary language of computing. Obviously, the fact that computer science has been dictated mostly by a small number of countries, most of them speaking either Germanic or Romantic languages, meant that the lingua franca of computing was very likely to be one of them. Clearly, a lot of the early development of computing came from English-speaking countries - Babbage's ideas in the 1840s, the resurgence of computing in the 1940s largely by English and American mathematicians (although I'm not forgetting about Konrad Zuse here), the development of FORTRAN, COBOL and Lisp in America, and having ALGOL 58 and 60 involving a good deal of American computer scientists. So, there's a historical reason.

There's also a technical set of reasons why English is seen so much in computing. English, for various reasons, seems to have a good set of words which are short and which adequately describe the operations of computing. "Move", "while", "for", "do", "print", "write", "read", "input" - just part of a large collection. What's more, for reasons that I can't adequately conclude, English speakers seem unreluctant to create and adopt neologisms or to adopt words wholesale from other languages when their own vocabulary doesn't suffice. In a field where things move so rapidly, and where ways of describing new things quickly is important, this is a major advantage. Finally, the 26-character alphabet, which does not incorporate diacritics or other accents, can be represented in a small amount of memory, which was an especially great advantage during early computing, but which is still useful now.

If (and more likely, when) Mandarin Chinese becomes a lingua franca in its own right, I sincerely doubt that it will displace English as a language of computing. Any dialect of Chinese is execrable when it comes to computing. Logographic characters are rubbish for programming purposes, while the language itself doesn't seem adequately able to keep up with the pace. Therefore, I expect a language with an alphabet, probably English, to be retained for the purposes of programming, even if Mandarin Chinese becomes the language of business, of science or of general discourse.
"The outright rejection of technology cripples the otherwise educated mind." - RAK
RAKtheUndead
 
Posts: 72
Joined: Fri Mar 27, 2009 10:18 am UTC


Return to Coding

Who is online

Users browsing this forum: No registered users and 6 guests