… "learning a new programming language is just about learning a new syntax"

It always grates on my nerves when I hear someone say that …because there’s a part of me that simply can’t bring myself to believe that it’s a true assertion. Rob and I discussed the point after he interviewed a candidate last week who had made this assertion, and asked me for my opinion. Ok the strength of my response does worry me a little, I’m not sure whether I’ve built a fence around this issue – that’s why I’m writing this to see if I’ve overlooked something. It’s certainly isn’t the first time I have heard this view expressed, in fact I’ve heard it a lot, and there’s a part of me that’s beginning to wonder whether there’s any validity to this assertion … so I’m hoping someone can tell me why it’s true. Me, I’m going to stick to my guns for now and try to explain why I think it’s wrong.

Here goes…

I think each language has its own philosophy, it’s reason for being different to every other language. Some languages were designed with a particular types of applications in mind for, example Fortran, which as a language was widely adopted by scientists for writing numerically intensive programs. Some languages are developed to be general purpose or universal enough to serve all purposes ( like Java for example ), whilst many languages try to be this, I don’t believe any really have.

The truth (ok as I see it ) is that there are many many programming languages out there and many more being developed. Some fall into disuse, others evolve or are extended to meet the ever changing needs of the communities that use them. Perhaps the need for this diversity arises from the diversity of contexts in which languages are used.

So I think you have to understand the contexts, and try to understand the reason why a particular programming language might be better suited for solving a problem than another, in order to do this I believe It’s important that you try to understand the philosophy behind that language. For me why is more important than how.

Yes, of course, you have to learn the syntax and the semantics of the language. But just understanding the syntax isn’t enough, you have to understand its nuisances, it’s idioms. Think of it as trying to teach a computer to speak a language. You can teach it correct grammar, but that doesn’t means the sentences it comes up with will make any sense … even though they’re grammatically correct.

As programmers we can be like that too, that’s why when we have a good understanding of a language and we move to using a different language we often fall into the trap of applying the idioms of the one to the other … or simply assume that we should be able to. A classic example of this is when a Java developer writes an object in C# and automatically starts writing public getter and setter accessor methods for each property he/she wishes to make accessible, when anyone who understands C# knows that whilst this works, C# has a completely different philosophy of how you expose Properties. It’s a crude example but I think it illustrates the point I’m trying to make, or at least I hope it does. In any case I believe the following is certainly true:

A language that doesn’t affect the way you think about programming is not worth knowing.

— Alan Perlis

Alan Perlis was the first ever recipient of the Turing Award in 1966, I often remember this quote because I recall how some of the students on my AI degree course used to complain that we had to learn way more languages than the students doing the normal Software Engineering degree. One of our Professors Aaron Sloman, used this quote to try to explain why it was important to be exposed to a wider range of languages better suited to the problems we were attempting to solve, and that this should change the way we think about programming. Anyway Perlis has written many often-quoted epigrams you can find some more here.

5 thoughts on “… "learning a new programming language is just about learning a new syntax"

  1. Pingback: I Really _Don't_ Know

  2. Pingback: Internet Alchemy » REST is Functional

  3. Pingback: REST is Functional « Internet Alchemy

Leave a Reply

Your email address will not be published. Required fields are marked *