“If you already know some programming language/framework X, what are effective ways to rapidly learn a possibly similar new language/framework?” I found myself pondering this question recently. Wouldn’t it be nice to discover a system to learn something new that optimally exploits what you already know?

In terms of approaches, there are two theoretical extremes:

  1. Forget everything you know. Start with a blank slate.
  2. If you know x1, x2, .., xn from language X, figure out the corresponding y1, y2, .. yn of language Y, assuming it exists. Then understand the non-overlapping differences. This makes the assumption that different programming languages have more in common than not, in terms of the underlying meta-model.

Reality would exist somewhere in the middle, with a bias that depends on the difference between what you already know and the thing you are trying to learn (even though that may not be known in advance). With that as a basis, here are some of the approaches I’ve tried

  1. Without any particular goal in mind, read through the official docs (preferably, a Getting Started guide). Poke away at whatever catches your fancy.
  2. Search for some generic tutorials. Pick one and follow along, doing the exercises, if any.
  3. Search for books on the topic. Pick one and follow along, doing any exercises along the way.
  4. Start with an end goal of what you want to accomplish. A todo app, a program to do X, a CRUD webpage with a Postgres backend etc. Search for tutorials to do that, picking up whatever associated/background knowledge needed to accomplish the task. Maintain a list of topics to follow up on some later date.
  5. Similar to the above, start with a book but skim read in order to accomplish the end-goal as quickly as possible.
  6. Redo a familiar, “right sized”, previous project in the new language.

For me, it takes a conscious act of will to stop shuttling between these approachs after some initial messing around and pick just one to pursue further. I usually read documentation/tutorials while keeping in mind some thoughts of, “I would like to accomplish X. Is this material helping me better understand how to do that?” It provides a workable blend of focus and openness to the learning.

Sometimes, the most suitable approach depends on the quality of the artifacts that you find. If a good and suitably scoped tutorial exists, maybe that is a better way to get started and accomplish your goal than reading an entire book. At some point you’d have to decide if reading a bunch of assorted tutorials and messing around is sufficient, or whether you should actually pick up a book and read it end-to-end, to fill unknown gaps in your knowledge.

Context for this musing

Once upon a time I knew a bit of C and C++. I used those languages to create a diagnostic tool for India’s first commercially launced Common Rail Diesel Engine in a SUV and for programming the in-vehicle computers at the vehicle assembly line. I even programmed the software infrastructure and alogrithms for a partially self-driving truck in C++. That was over a decade ago. Since then, I’ve been steadily “degrading into management”. Writing code is a fading memory. But occasionally, partly driven by curiosity and partly as an act of rebellion, I attempt to learn a new programming paradigm, language, or framework.

Functional Programming is fascinating. Languages that support strong safety guarantees and formal analysis (like Ada or it’s safety-critical subset SPARK) seem to solve so many issues plaguing the systematic and safe development of safety-critical systems. Formal modeling of systems at high levels of abstraction with e.g. Executable UML, needs to be dragged out of its hole in the model based systems engineering community and democratized. This “web development” thing with a UI running in a browser that talks to a backend server seems like an incredibly useful skill to have. Basically, there’s a world of interesting technologies to explore, learn, and apply … while juggling a demanding job and family needs. How to do it all optimally? Optimal meaning: at a pace that allows rapid assimilation and subsequent application, while preserving the joy of unhurried, non-linear explorations. Avoiding anxiety-inducing thoughts like, “This learning is taking too long; I’m already itching to apply it in some meaninful way to get those sweet dopamine hits before this particular slot of free time disappears.”