Writing by Peter Hilton

Learning another programming language

The second language is hardest - 28 July 2014 #programming

Foreign language

There’s no point being upset because ‘your’ programming language is threatened with obsolescence. Just learn another language: it will probably be tough, but it’s worth persevering and doing it again because it gets easier after the second one.

Foreign language learning

During many years living in the Netherlands, I observed two extremes among expats learning Dutch as a foreign language. The fast way involves going to ‘the nuns’, which is well-known in the Netherlands as a highly effective one-week intensive personalised immersion course. This requires serious commitment and is also seriously expensive.

At the other extreme, the slow way to learn Dutch involves no great effort at any point, and mostly consists of several years of not actually resisting the idea. This means making the occasional effort to understand things you hear and read, looking up the occasional new word, and occasionally attempting new spoken phrases and eventually trying to have conversations with people.

There is also a third group of expats who don’t learn to speak Dutch at all, even after many years. Reasons for this include deciding to concentrate on improving their (non-native) English instead, or that it isn’t important to them, lacking the confidence to try or just plain laziness.

One thing is common to all three situations - learning Dutch quickly, slowly or not at all - and that is dealing with being a beginner (or not). Speaking a language badly means sounding stupid and, on occasion, being laughed at. Some people find this difficult to get past; the rest don’t get past it at all.

Programming language learning

At first glance, the big difference between spoken languages and programming languages, for the average programmer, is having your own native spoken language. Barring rare exceptions, we all have a mother tongue. But are programming languages so different?

In what might be some kind of baby duck syndrome, the language that teaches you programming is special. As time goes by, you become ever more familiar with the language and how it’s used. You gradually master its syntax and grammar, its idiom and libraries. At this stage, awareness of other languages is likely limited to the programming equivalents of taking a foreign language phrase book on a summer beach holiday. Writing the odd script or tweaking someone else’s code isn’t language fluency.

Like learning a foreign language, learning a programming language properly is hard. There is no short-cut in time and effort. You can learn to speak and understand a foreign language quickly, with immersion and intensive study, or easily, by living in a community of native speakers and making small but continuous effort over the course of a few years.

Similar alternatives apply to programming: either a lot of hours all at once, or a lot of hours spread over a long period. Either way, you can’t get anywhere until you learn to be comfortable doing it badly at first.

The second language is hardest

Problems, and parallels with learning a foreign language, come with the second language. For example, Apple’s recent launch of Swift may have led to dismay from a few iOS developers using Objective-C, worried about devalued skills. If you’ve built up a lot of experience with a single programming language, the idea of having to start again is intimidating and it would be natural to feel somehow cheated.

Fortunately, frustration with having to learn a second programming language turns out to be short-lived. In the case of iOS development, much of the experience is with the platform in general, and the Cocoa API in particular - understanding that is still relevant. The fear and frustration of returning to beginner status is balanced by a better understanding of programming in general, plus the recognition that language syntax is the minor part of what you learn.

Learning the second programming is hard for the same reason that learning a second language is hard: it’s a shock to become a beginner again, frustrating to feel limited, and scary to be doing something badly in front of other people. That is ultimately the hardest thing about being a beginner: achieving the humility that makes it comfortable. It takes some courage to get past this and ultimately achieve a higher level of skill.

Getting past language number two is perhaps the greatest value to books like Seven Languages in Seven Weeks and The Well-Grounded Java Developer. If you look at several languages quickly, as a kind of experiment, then the pressure to master just one of them is relieved. Instead, you can stop at the level of basic working knowledge, and merely be a novice in each with the renewed self-confidence of a generalising specialist.

If there’s any truth to this, then it also suggests a danger of learning to program using a single language in the first place. Perhaps it’s important to switch between several languages at the critical stage of learning to program. Alternatively, dabbling in several different languages before using one seriously might help a novice programmer retain some perspective.

Finally, if nothing else, this highlights the value of being able to learn by becoming a beginner again, as expressed so well by the third rule of a Zen Programmer: ‘Always try to see technologies from a beginner’s mind’.

Peter Hilton learned French the usual way at school and university, Dutch the slow way, and at least ten programming languages by simply joining a development project and getting on with it.

Photo: Lily

comments powered by Disqus