Free Newsletters

   All InfoWorld Newsletters
Strategic Developer | Martin Heller » When Languages Interfere

December 14, 2007 | Comments: (0)

When Languages Interfere

I've learned a lot of languages, both human and computer. When I learned Latin in High School, it mostly helped my English. When I learned German, I had both help and interference from my knowledge of Yiddish; ditto for when I learned Dutch. Similar things happened with Russian (college) and Chinese (grad school), although that wasn't quite the same mechanism: my brain would sometimes serve up a word from a different language than the one I was trying to speak.

As I mentioned Wednesday, there are some common constructions that have different meanings in the different languages that were inspired by C. The new object constructor isn't the only place where subtle errors can occur if you get confused.

On the other hand, learning Pascal back in the day mostly helped my Fortran. Learning many different assembly languages didn't seem to cause any interference: writing assembly language was such a painstaking process that I could usually remember what processor I was writing for at the time.

I hear from people who would rather write Java or C# than mess with JavaScript. They're the kind of people who like tools like GWT and Script# and Volta. I also hear from people who would much rather write JavaScript than Java or C#.

Do you program in more than one language? On balance, does already knowing one programming language help you to learn another, or do the languages interfere with each other and cause you to make errors? Do you find yourself preferring one language over another?

Discuss.

Posted by Martin Heller on December 14, 2007 08:18 AM


RATE THIS ARTICLE:





 

  •  
  • COMMENTS




I find that they do interfere, but a different way than I think you mean.

When I notice language (and tool) similarities, I deal with the complexity by abstracting up a level. In other words, I conceptually make a language group and say to myself "all languages of this type have a function (or concept) following this generalized pattern." It's the analyst in me and I do this automatically.

So I easily remember that a given language CAN do a specific task, and I can spit out template code on command. However the specifics of the operator I produce may not meet the language's exact requirements.

Posted by: Brian at December 14, 2007 09:45 AM

We had that problem in spades in the early days of our Ada compiler, where parts were written in Pascal and parts in Ada. The languages were too similar to keep distinct in my mind. The ultimate solution was to convert the Pascal into Ada.

My theory (based on that experience) is that using multiple languages with the same principles is not likely to be helpful. Using C isn't going to add much to the experience of using Ada, for instance. OTOH, very different languages (like PERL) have a useful place in the developers toolkit - they can broaden ones horizons.

Posted by: Randy at December 17, 2007 11:45 AM

I think the answer must be "yes and no". Learning programming concepts and their execution in different languages helps put a new language in perspective and aids in the learning curve. Actively using languages with similar grammar and syntax, however, can introduce the "racquetball effect".

It has long been held in the sports community that being proficient in tennis will assist in learning racquetball, (and vice versa). Switching back and forth between the two, however, is held to "destroy your game" in both.

Posted by: Rambo Tribble at December 18, 2007 11:03 AM

I have programmed in assembly (6502, Z80, 80X86), threaded interpreted (Forth), block structured (Basic, C, Pascal, Fortran, PLM), and object oriented (C++). And dabbled in more. (Ruby, Matlab, misc. scripting)

The shift between languages with common principles is small - just the details of syntax. There is a little lost time getting the syntax right, but it is not a big factor.

The shift in thinking between kinds of languages is large. Learning a new way of thinking about programming takes 1-3 years. In Forth, well written subroutines average 7 compiler symbols in length. In C++, OO abstractions enable new ways of solving problems.

Knowing one block structured language makes it straightforward to do useful work in another such language. Just learn that language's equivalent operation, and what it can't do. But knowing Pascal makes it harder to master the idioms and patterns of a threaded interpreter.

Any interpreted language permits rapid exploration in a way any compiled language is unlikely to. This is part of why Forth, Smalltalk, Perl, and Ruby (at least) have fanatic developers. Changing how one solves problems is a bigger issue than having to type different symbols.

Posted by: Mark at December 18, 2007 11:04 AM

I program in about 8 languages, from Java to COBOL. What I find is that I forget some very simple commands when I go back and forth between languages. I would be very embarrassed if people knew how often I did it.

Posted by: JB at December 18, 2007 12:09 PM

I agree from my experience that it is easier to learn and use new languages that are similar to ones you already know. I started with Java and JavaScript, and have had an easy time learning other OO and scripting languages, but I would have no idea how to approach other methods.

I think some of it may have to do with an individual's language skill, strangely enough. Logic is logic, so reason and critical thinking are obviously important in a programmer, but familiarity or skill with other spoken languages may make a difference.

With spoken language, you need to shift your thought patterns so that you're actually thinking in the language you're using. That technique is key to fluency, and through my own experience with language study I have seen that some people have more trouble doing that than others. Maybe programming is the same way, in that you have to think in the language you're trying to use.

Posted by: kdub at December 18, 2007 12:51 PM

Hi Martin,

Like you, I've learned many languages, both human and computer. For the last two years or so I have really enjoyed Ruby. So much, in fact, that I may have become a Ruby-snob. For the first time in my life I look down on other languages and I get seriously annoyed when I have to use Java, VB, C#, etc. Thoughts like "this would be so much easier|more readable|shorter|etc. in Ruby" keeping going through my mind.

The other interesting thing is that my experience with dynamic languages like Ruby reminds me of the thoughts I had when I first learned C++: "This OO stuff is a bunch of hot air - you can do the exact same thing in C with function pointers". Well, that may be true but you can do it a lot easier, shorter, etc. in C++ (and now even more elegant in Java and C#). So that's how I feel about Ruby, and it applies in many aspects of the language.

I very much like your insight about learning one language making you better in another language. Pascal made me a better Basic programmer. C++ made me a better C programmer. Ruby made me a better C# programmer.

Finally... there are languages you learn, and languages you actually use to write a significant piece of software in. My favorite column of all time is "Exotic Language of the Month". I don't remember if it was in Computer Language magazine or in DDJ. Someone should do a blog like that.

Posted by: Mike Sax at December 18, 2007 09:45 PM

Yes I do use several languages on a daily basis. I tend to find most can be grouped into "families" of languages where the knowledge of one member of the family can help learn the other members of the same family much faster although that can sometimes turn out to be a dangerous process leading to programming C Java-like or vice-versa for instance.

I do have a preference for OO-programming with strict typing but hey, there are different languages and each has its given specificities and strong points. So, it's pretty difficult to discard any language as "useless" just as it's difficult to like them all the same.

As to interference, I guess that mostly happens when I have spent a month or so using JSP and then have to get back to PHP for instance. Things like strlen() or thing.length() (or whatever) can get muddled up sometimes. Just the brain playing up.

As for human languages I just "luv' em". I find the similarities like "étable" / "stable" / "Stall" / "stal" are just such wonderful reminders of our common roots and amazing diversity... muddled or not, I couldn't give that up for the world!

Posted by: Elinor at December 19, 2007 03:36 AM

Mike, how nice to hear from you! I don't think we've seen each other since a conference about 10 years ago.

I think the "Exotic Language of the Month" column was in Computer Language magazine, at least 15 years ago. I liked it, too. I did something similar in my online "Mr. Computer Language Person" column on Byte.com.

Posted by: Martin at December 19, 2007 09:26 AM

Martin, yes I believe it was Geek Fest at Comdex Atlanta in 1994 or 1993... Deedee Walsh was handing out prizes to people who had piercings in parts of their body other than their ears. I think Jim McCarthy won. I've been reading your latest columns/blog post and I really enjoy them! I'll check out your Byte.com column. Looks like you're still having fun exploring new technology and sharing your discoveries.

[I remember Deedee throwing swag at lots of conferences. I don't remember that particular contest. :)

I think we also met at one or more WinDev conferences. I think I remember Kim Crouse asking you for a new installation feature for a game she was working on. --mh]

Posted by: Mike Sax at December 22, 2007 06:25 PM

Technology White Papers

 

InfoWorld Technology Marketplace

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
» BUY A LINK NOW

Sponsored Technology Links