Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Linguistic relativity is the idea that language shapes the way we think. My question is, how much, and to what extent, does this apply to programming?

  • Are some native, natural languages better-suited for thinking about programming than others? For instance, can the following be stated more concisely in a non-English language? Select a pivot. Move all the items less than the pivot to one side of the list, and all the items greater than the pivot to the other side.
  • Does a Chinese-speaking programmer view programming in a radically different lens than an English-speaking programmer, or do the differences fade away when both are immersed in the subject?
  • Are some programming languages and domains easier to think about in one language or another. For instance, is it any easier to grok Ruby if you are Japanese because the creator of Ruby is Japanese?

Note that this question is not focused on "how do programming languages affect the way people think about programming", but rather "how do natural languages affect the way people think about programming".

To get it out of the way, one language that clearly has a pragmatic advantage is English. I think the advantage has little to do with programming languages choosing English keywords like if, for, while, and do, just as musicians who don't speak Italian aren't tripped up by words like forte. It has more to do with communication of ideas with other programmers, as English is the lingua franca these days, at least in the programming world. For instance, to ask a question in StackOverflow, you really need to know English and know it pretty well if you want good answers. Although this sounds like an imperialist attitude, it really is true in practice.

That aside, how do the intrinsic properties of languages affect how programmers who speak them think about data structures, algorithms, etc.? Are any languages particularly concise when it comes to talking about logic and programming, allowing native speakers of those languages to think faster?

share|improve this question

closed as primarily opinion-based by gnat, Bart van Ingen Schenau, GlenH7, Dan Pichelman, Ampt Dec 29 '14 at 15:29

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

You can state that very simply to any competent programmer. Implement quick sort. –  Josh K Sep 26 '10 at 21:27

7 Answers 7

up vote 3 down vote accepted

Ah, the Sapir-Whorf hypothesis vs. the Chomsky Deep Structure hypothesis wars...

Programming is mathematics. Mathematics is applied philosophy. The question then becomes, which natural language can exactly describe mathematical concepts without significant head-scratching. Put another way, which languages can deal in Aristotelian metaphysics easily?

The proverbial 'savage' language may have initial difficulty expressing the first-order abstractions that are required. However- however! - humans can learn new words, and new concepts. Ancient Greek didn't start out with philosophical terms; they had to be invented and then ported to other langauges.

Considering that mathematics is a universal, I postulate that the strong Sapir-Whorf hypothesis is false.

share|improve this answer
"Mathematics is applied philosophy" Explain? –  Frank Shearar Oct 8 '10 at 10:23
@Frank: Historically, that was the case. When you do a cursory look at 'foundations of mathematics', it becomes pretty evident that it's philosophically grounded. E.g., the whole intuitionist argument. –  Paul Nathan Oct 8 '10 at 14:56
I won't argue that some mathematical questions are philosophical, as you say. It seems to me a far leap from that to saying that "Mathematics is applied philosophy". –  Frank Shearar Oct 8 '10 at 16:42
@Frank: well, if the foundations of math are philosophical, then it would seem that that which is derived from the foundations is also philosophical. No? Yes? –  Paul Nathan Oct 8 '10 at 20:02
@Frank: Terrible, huh? Some liberal arts major is sniggering from his latte now, I bet. :) –  Paul Nathan Oct 9 '10 at 6:04

Turkish is a very interesting language as it has strict rules without exceptions (that i am aware of), is nearly perfectly redundant-free, has no grammatical gender, and on word can express as much as a sentences in english.

In the past "Çekoslovakyalılaştıramadıklarımızdan mısınız?" which means "Are you one of those people whom we couldn't make resemble from Czechoslovakia?" was very popular and accepted as the longest word in Turkish. However, the question suffixes (mısınız in this case) are written separately, so though it is one word, it seems like two words when the word is written. Also, longer versions of this word could be made easily, such as "Çekoslovakyalılaştırabildiklerimizden miydiniz?". For these reasons, the word lost its popularity, but it is still a popular tongue-twister in Turkey.

talking in turkish makes me the think about what i want to achieve, what information I want to transmit, and less about what words to use.

Of course Turkish has words to represent the biological gender. But it doesn't have separation into he/she/it — in Turkish "o".

Or in Spanish you would say "profesor/profesora" and in German "Lehrer/Lehrerin". In turkish you have to use extra words to indicate the gender — similar to english.
In turkish teacher is öğretmen. To point out a female teacher you'd say "kadın öğretmen" — woman teacher. But despite of german, where — if not femalelized by adding an "-in" — the default is male, öğretmen has no gender, as there isn't.

Another thing that isn't available in Turkish are articles like "el/la", "the", "der/die/das" — as it usually is just information that is already available by the context.
But there are words to express "this", "este/esta", "diese/dieses/diese", for example "bu".
This is extra information, as it is pointing on a certain object.

share|improve this answer
Without grammatical sex, where will little Turkishes come from? (By the way, when I saw the question but before looking here, I thought of Turkish. While I don't speak it, I'd heard about how regular it is.) –  Randall Schulz Sep 27 '10 at 3:15
Apparently Smalltalk's syntax is even closer to Turkish than it is to English: smalltalk.gnu.org/blog/zuluuuuuu/smalltalk-and-turkish –  Frank Shearar Sep 27 '10 at 8:43
@Frank Shearer: time to learn smalltalk! –  vikingosegundo Sep 27 '10 at 12:26
@Randall Schulz: U got me ;) I always mix up the term sex and gender... –  vikingosegundo Sep 27 '10 at 12:30
I have heard Sanskrit is meant to be the most like a computer language according to some study, you can google it. I am not sure how true that can be but since Sanskrit never took off as a mainstream spoken language and also since it was used among academia for technical studies of the time it's probable it's unlike the natural spoken languages of today. Turkish sounds very sweet to my ears (just aurally) but if it all it and Sanskrit talk like programming languages boy that would be very boring. The last thing I want to hear when asked: "is it boy or girl?" is "yes". –  nawfal Jul 11 at 14:17

This was a topic I was very interested at some time, therefore my even greater (now) sorrow, that I cannot find the bookmarks I had back then.

I did save a link I stumbled the other day onto, Do Different Languages Equal Different Realities? that tangents somewhat onto it (read the comments as well). Some are interesting.

Anyways ...

share|improve this answer

In my opinion, the natural language doesn't matter (or at least shouldn't matter) at all when talking about the methods or ideas you are trying to realize with your code.

As you said yourself, when working with the code itself and writing documentations about the code english is the most appropriate. But as the code itself is just a handcraft, the real strength of a programmer/computer scientist lies above that with ideas, algorithms and such things - and then, the language those things are described in is completely unimportant for the actual content.

share|improve this answer

English is actually pretty efficient and concise. Translation into most languages will make an idea longer to express.

It's also generally accepted that there are no primitive natural languages. All natural languages in active use have an equal level of expressiveness. That isn't to say ideas aren't formed by language, but I don't think natural language is a big influence.

share|improve this answer
I find that Chinese is probably the most terse language I've ever encountered, both when written and spoken. Translation length is usually just over half of English. –  Jon Purdy Sep 27 '10 at 0:15
But isn't the symbol complexity just higher? –  Joeri Sebrechts Sep 27 '10 at 5:10
Chinese is APL of spoken languages you mean? :) –  nawfal Jul 11 at 14:09

I don't know that any particular natural language lends itself to better programming (except maybe Latin?). I do know that knowing more than one language is pretty powerful.

Dijkstra said in one of his last interviews (as reprinted in CACM Vol. 53 No. 8, p. 44):

There is an enormous difference between one who is monolingual and someone who at least knows a second language well, because it makes you much more conscious about language structure in general. You will discover that certain constructions in one language you just can't translate.

share|improve this answer

I think it's more likely that the programming language you are using will shape the way you are thinking about the problem, the variable and class names, etc, are just characters representing something. Though it is very likely that programmers in different cultures think about programming differently because of their spoken language and the way that they learned.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.