How to really master a programming language

programming-languages

I know that learning a language, you can simply buy a book, follow the examples, and whenever possible try the exercises. But what I'm really looking is how to master the language once you've learned it.

Now I know that experience is one major factor, but what about learning the internals of the language, what is the underlying structure, etc.

There are articles out there saying read this book, read that book, make this game and that game.
But to me this doesn't mean to master a language. I want to be able to read other people's code and understand it, no matter how hard that is. To understand when to use a function and when another, etc etc.

The list could go on and on but I believe I've made the point. 🙂

And finally, take whatever language as an example if needed, though best would be if C was taken as an example.

Best Answer

I have to answer, "All of the above." People argue about whether coding is an art, a craft, an engineering discipline, or a branch of mathematics, and I think it's fairest to say it's some of each. As such, the more techniques you bring to mastery of the language, the better. Here is a partial list:

  • Use the language all day, every day. Usually this means being full-time employed in the language.

  • Read all you can about the language. Especially, "best practices" and idioms.

  • Join a users group to talk with others about the language and what they do with it.

  • Work with other people's code! There is no faster way to learn what not to do in a language than to have to clean up after someone who did something awful.

  • Support the code you write - every bug becomes a tour of your worst decisions!

  • Study computer science and languages in general

  • Learn a very different language. A great compliment to C would be a functional language like Lisp. This will turn the way you think about your procedural language inside out.

  • Learn to use the frameworks and APIs available for that language.

  • Take the time to do your own experiments with the language. SICP is not applicable to C, but the attitude of learning a language by testing its limits is a very productive one.

  • Read the history of the language to learn why it was made the way it is.

  • Attend conferences to hear the language authors speak, or to hear what industry leaders are doing with the language.

  • Take a class in the language.

  • Teach the language to others (thanks to Bryan Oakley)

In summary, do everything you can think of. There is no way to know everything about most languages. Every learning technique you use brings an additional perspective to your understanding.