Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Programming as a Foreign Language (redsquirrel.com)
39 points by redsquirrel on May 17, 2012 | hide | past | favorite | 15 comments


I wish more developers treated learning to program like learning a foreign language. When you're learning a foreign language, your #1 goal is to cast off any poor grammar or pronunciation and sound like an intelligent native speaker. It's been my experience that people often don't care very much about doing this with the programming languages they use.

Routines that are too long and ought to be refactored into smaller ones are akin to run-on sentences. Leaving out semicolons in your JavaScript is like speaking French in an Italian accent because you already know Italian and French people seem to more or less understand it. And people who refuse to follow prevailing code style guidelines? Those are your "Everyone there speaks English anyway" folks.

Such poor communication skills would be humiliating when trying to communicate in a foreign language, but for some reason people often wear them like a badge of honour when trying to communicate in a programming language.


"I wish more developers treated learning to program like learning a foreign language. When you're learning a foreign language, your #1 goal is to cast off any poor grammar or pronunciation and sound like an intelligent native speaker."

I'm not sure that's true at all. When I learn a foreign language, my aim is to be able to communicate. The extra effort required to be perfect far outweighs what I need from it. The native speakers I talk to are quite capable of taking my bad grammar and understand my meaning. Wanting to sound like an intelligent native speaker isn't just at the bottom of my list of needs; it's not even on the list.

When learning a programming language, I have no choice; I must have perfect grammar.

"Such poor communication skills would be humiliating when trying to communicate in a foreign language"

Not at all, in my experience. Simply having some simple grasp of the local language is met with delight; just having made the effort goes a long way, even if the locals themselves prefer to speak with me in English.


Makes me think about programming IN a foreign language. One time we had to fix some code a Turkish client had added to our system. The spec and the code were in Turkish (imagine Turkish COBOL if you will). We somehow got it done by trial and error (Is THIS what you want? No? How about THIS?) I have no idea whether this means anything, but we came away saying "Berklat bokari" to each other at random moments on future assignments. Those words or something like them kept appearing in the Turkish code.


For a lot of the world population, english, as common as it may be in programming, is still a foreign language. People less fluent in English are that much less likely to try scripting something. Not only would the language keywords make little to no sense, but the supporting materials and comments as well.


Thanks to the British Empire and partly to the United States, English is effectively the international language of Business, though.


Yup. I had this sort of problem once. The code for an interactive television set-top box was written in a pseudo-assembler-ish language. It had been built and designed by French-Canadians and the assembler acronyms were based on French words.

Having pretty much zero French myself this was often non-trivial for me :-)

(Fascinating hardware though. This was pre-digital interactive television. Ran on four separate analog signals with the set-top box switching between them based on the code and what the user did. Ran on the Videotron cable network in the UK for a while before they were swallowed up into CWC. If any UK Videotron viewers remember things like "Gone to the Dogs" I worked on those :-)


My girlfriend is seriously interested in linguistics. When she discovered I learned to code when I was a kid, and given the speed at which I learn (and forget!) foreign languages during my journeys in Europe, she ended up with the idea that learning a programming language is a similar procedure to that of a speaking language.

She also thinks that my ability to learn languages has been maintained strong by the fact I learnt a new programming language every year.

Also, the fact that bilingual kids are able to retain for a longer time the ability to learn languages made her think that as a kid I could be considered as bilingual.

I had the chance to confirm this looking at a colleague of mine who started to code as a kid too. Looks like we have some common abilities in language learning.


I had to work on some dutch COBOL once, was actualy realy easy if you take the standard approach and that is to ignore ALL comments as the code is the only documentation you can truely trust.

But the only truely universal language for programming has to be bainfuck :).


It's funny, but I've actually used the opposite idea: approaching the grammar of foreign languages like a programming language. Most programming languages are just historic collections of arbitrary rules, most of which make some amount of sense. Most natural languages are the same thing on a much grander scale. Thinking about grammar like this helped me learn it properly.


There are some interesting research efforts that explore the link between early-age bilingual learners and positive cognitive effects [1].

What is striking to me is that hackers have long made statements that learning different programming language paradigms makes us better hackers. While we can make anecdotal arguments that being a good functional and a good imperative programmer makes us better hackers in general, the above research is exploring the idea that multi-language proficiency has positive cognitive effects that cross domains.

[1] Carlson S. M. & Meltzoff A. N. (2008). Bilingual experience and executive functioning in young children. Developmental Science, 11, 282–298. Availabe at http://ilabs.washington.edu/meltzoff/pdf/08Carlson_Meltzoff_...


Interesting comparison, but I find it hard to relate to at all simply due to the sheer amount of words you need to learn in a real foreign language to achieve fluency. Seems much more daunting to me...but I guess my glasses are tinted.


Try http://memrise.com/ for vocab learning - it's really helped expand my French vocabulary quite lot and seems to make it stick well. Doesn't really help with spoken fluency though, for that you just need lots of practice!


Thank you so much for bringing this site to my attention. It seems to have become a nice replacement for smart.fm which I used a few years ago.


Hey, that's a really neat site! I like the way it's implemented.


I'm certain real-world languages are much harder too. I'm surprised that the author, a perler, didn't make the connection to Wall's "Natural Language Principles in Perl":

http://www.wall.org/~larry/natural.html

This document is quite old and I disagree with some of those things now (in particular Perl's "more than one way to do [say] it" lead to a lack of enforced standard idioms; compare python). But other points eg "acceptable levels of competence" are valuable for the humble programmer to keep in mind.

Similarly, I like the idea of a programming "accent": the effects of previous programming languages on your current language. For example a (ahem) rubyist that starts to write in python might reach for map() when they perhaps ought to use list comprehensions. A speaker with a heavy accent can still however make themselves usefully understood.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: