How difficult is it to master a programming language?

Recently, I took part in a discussion that was triggered by the question “How difficult is PHP to master?”

As an engineer, the answer has to start “It depends”.

Some languages are easier to learn than others; prior experience helps; the sort of task or problem you are trying to solve will have an influence.

I started programming in the late 1970s – learning a bit of Basic (the one with line numbers and GOTOs) and a little bit of machine code (yup – patterns of 000 and 111). Since then I have worked on, and taught, a number of languages including various assembly languages, C/C++, Java, Perl, PHP, Visual Basic, VBA, and C# (just to mention a few) as well as SQL, macro and CLI languages.

Learning the syntax

All languages have syntax and structure. Some languages seem to have a lot more syntax than others. The instructions and statements you have to write are full of arcane symbols and follow Byzantine rules. Surely to master a language you must master the syntax.

Languages also have idioms and conventions – the way that you tackle a particular problem will depend on how people generally use the language. Of course there are programmers who make exceptions, and in consequence write code that doesn’t work in the way you expect. Writing in the correct idiom helps others to comprehend the code.

We should also remember that different languages support different concepts – most languages support the basic structures of sequence, selection, and interation by providing suitable keywords. If the language doesn’t directly support a concept, you can often simulate it, although you may be moving away from the conventions of the language if you do so.

Learning libraries

When I taught C, I had to teach some aspects of the standard I/O library. When I taught C++, I had to teach some aspects of the iostream library. It it not sufficient to just learn the syntax, but you need to know the basic libraries and templates. It is not impossible to write C without using stdio, but it is quite challenging and the resulting code is less “portable”. It may be possible to write a Java applet without using Swing or AWT, but I wouldn’t like to try it.

Standard libraries and standard templates are not additions to the language – they are really quite integral to becoming a master of the language. Sure, you can roll your own, but unless you have very specific requirements it is better to use the standard libraries. In any case, you can learn a lot about the language by understanding how the libraries are implemented.

Tools

We used to use very simple tools – a text editor, a couple of scripts to build and link. Now, before you start to create programs, you need to set up a complex developement environment. Whilst that is not difficult, understanding how the various support files, the project properties, the deployment strategy are things that you need to be aware of and able to manipulate.

Other issues

Once you know the syntax, idoms, libraries and development environment, there are other things that are not directly related to the language itself, for example, knowing how to create an CLI (command line interface) or GUI (graphical user interface) or API (application programming interface) using the language.

Over the years, the problem domain has changed – although you may still write a program in isolation, there is an increasing need to understand how connect to and access a database using the language or to use the language to create and display content in a browser.
Not to mention how to perform other specific tasks (manipulation of graphics, video, audio …)

So – I would suggest that learning a programming language is a little like learning to play Go – may take a short time to learn the rules, but a lifetime to learn the strategy.

Leave a Reply