How I Learn

I learned to code late. It was not until around the time I graduated with my bachelor’s degree that my interest in programming began, and I started that journey with everything to learn. Now that I’ve been programming professionally for over a decade, there is still no shortage of new things to learn, working in a field in which every project means learning a new technology stack, every year brings a new crop of technologies, and existing technologies are always moving towards more sophistication and complexity.

I remember reading in a blog, the name of which I don’t recall, that you are ready to get out of the programming business when you are ready to stop learning. (Whoever you are, blog writer, I agree with you.) A programmer can expect education to be an on-going concern, and, if you do happen to be a programmer, hopefully that sounds like an opportunity rather than a sentence. Sometimes this does takes the form of you being up later than you wanted to be, trying to get your head around some huge API or digging through search results for the Stack Overflow page that provides the answer to the perversely recalcitrant problem you’ve been hacking away at for hours. But these situations are the exception. Normally your motivation will be either your own curiosity or an immediate need related to something you are working on. In this post I will indulge in some reflecting on my experiences of this process of continual education, which may be helpful to you as a fellow coder or just someone confronted with a lot of information that they want to get into their head. Consider this a set of study tips for the kind of informal, self-directed study that is common for information workers.

When embarking on the journey of learning a new subject, as programming was to me at one time, there will a period of plowing through paragraphs littered with terminology that is as strange as hieroglyphics (to someone who doesn’t understand hieroglyphics, like myself). Tackling any large subject will require you to spend a certain amount of time in this wilderness, trudging through swamps of cryptic symbols, wandering through labyrinths of convoluted concepts and tripping over unfamiliar terms. Reading without understanding can be tedious and frustrating, but keep in mind that the first time you come across a particular term will be the only time that you come across it for the first time. If it really is important to the subject you are studying, you can expect to see it again, and each iteration will enforce its significance, adding a bit more substance to the growing snowball of your understanding.

Repetition, Repetition, Repetition

Repetition is important for turning the foreign into the familiar, and my experience is that it’s most effective when it comes in the form of similar material in a different dress, rather than verbatim repetition. After reading a paragraph, if I don’t feel like I quite got what it was saying and try re-reading it, it seems that my brain processes the words as already explored territory that it can safely ignore, and so not much is gained by this kind of repetition. On the other hand, if I later encounter the same or similar information, but expressed with different words, in a different modality, such as a video rather than a book, or otherwise encoded in a different way, then my mind, instead of seeing this as an opportunity to check out, will be actively engaged with trying to link up what it is seeing with what it already knows.

I have found that this practice, of learning by repeatedly encountering the same information under a new guise, to be a useful trick for learning new things in general. This may mean reading several books which cover similar material, or reading a book and then watching a video series, or taking a class and then working on a personal project; any way that you can get your mind to actively correlate what you are reading, viewing or hearing to what you already know. Eventually you do come to a point of diminishing returns: although I still come across explanations of the basics of programming in various contexts, when I do it barely registers with me, which is, I suppose, when you know you’ve reached a solid grasp of the material.

Building on What You Know

Along with learning the meaning and significance of individual concepts, understanding is boosted by building up connections between the various ideas involved in your area of study. As you build a new vocabulary of terms and concepts, start making connections among them: how two concepts work together like a ball and socket, how one idea forms the basis on which another stands, how several are connected like the links of a chain, or any other way that you can put them into a relationship which creates mutual reinforcing connections.

Take, for example, object-oriented programming, something that the student of computer programming will encounter before long. There are fundamentals concepts like inheritance, which lead to specific programming language implementations of inheritance. Having an understanding of how this feature works in one language gives you a starting point for learning the next language, where you will have to broaden your understanding of object-orientation as you find that the way inheritance works in, for example, Java has some significant differences from how it is implemented in JavaScript. Then there are best practices related to inheritance, such as the injunction to prefer composition to it. Once you have a solid understanding of object-orientation, read some of the criticisms of OO as a programming paradigm and look into alternatives, such as purely functional or stack-based languages. Going down any of these avenues will give you a more complete picture of the whole space of what object-oriented programming is and what you can do with it, which will not only help you to get actual work done but will help put any particular problem that you come across into a richer context, in which you have more conceptual resources to bring to bear on the solution.

Optimization Techniques

I have also found it useful to optimize your learning by overlapping multiple areas of study. If you read a book about a programming concept with examples in a programming language that is new to you, you won’t have to be an expert in the language because you will be able to copy out the examples directly from the book and run them, and you will start leaning that language as a side-effect. Learning assembly language programming will likely impart some understanding of how hardware works, of what compilers do, a little about operating systems and something about binary file analysis. Conversely, knowledge of any of these subjects will help you learn assembly language.

Years ago when I was reading the book Paradigms of Artificial Intelligence Programming, I translated an Othello playing program described in one of the chapters into a browser-based game using an HTML table for a board, simultaneously getting some familiarity with Lisp, AI, JavaScript, HTML and CSS. Not much of a familiarity with any one of them; just a toe dipped in each, really, but as I mentioned above, the first time that you come across something will be the last time that it is the first time, so gaining some experience with all of these subjects, however minimal, will get you that much closer to understanding any one should you choose to explore it further.

DIY Learning

Of course, with programming there is no substitute for hand-on experience. There is a certain amount of simple muscle-memory involved: learning a new programming language means learning its syntax and semantics, its libraries and best practices, but really learning it in a way that will actually make it useful to you means being able to hammer out a class, function or loop without any conscious effort, because that knowledge has moved from your head to your fingers. In fact, although copy-and-paste programming is verboten in production code, when you first come across a new library or language feature, the process of simply copying what you see, then running it to see what it does, helps to tie cause to effect, and trains your fingers to repeat that set of strokes in the future when you start putting it to real use.

Then there is the question of what to learn. Something that you hope will get you a job? Something esoteric and impractical but interesting? Something new and different? Where you spend your educational hours will depend on your own goals and preferences, level of satisfaction with your current work situation, and many other factors. I won’t try to give advice here, which will likely be only relevant to my own experience, but I will say that interest and experience are the best guides I’ve found for identifying what is worth pursuing. What you find interesting will change as you gain experience, but in order to get that experience you have to find something that looks interesting and pursue it, forming a feedback loop that propels your educational journey forward.

Finally, I want to say something about the benefits for computer programmers of learning things outside of the arena of computing. It is well known that much of the mental processing that we do happens in the sub-conscious, only to appear in your conscious thoughts seemingly out of nowhere. I can’t say for certain, but I have a suspicion that this off-line processing draws on resources that we may not explicitly consider to be related to the problem at hand, that our brains may make use of any resources it has available when performing this magic trick of thinking without conscious effort. This seems to me a good reason to pursue a wide range of interests.

With all of the preceding thoughts, I’m not guaranteeing amazing results or trying to make it sound like I’ve come up with a revolutionary new way to learn, just putting out my intuitions and experiences about how learning works and how it can be done well.