Using Old Tutorials for New Tricks
[Note from Randy: This week we've got a guest post from Paul about a clever way to learn a new programming language. Certainly better than all the attempts I've made not-learning programming languages over the years. Also, don't miss a link to a post about taking snapshots with dbt that a reader submitted at the end.]
Introduction
My journey in learning Python started with Zed Shaw's "Learn Python the Hard Way" book. One of the core instructions in the book was that you couldn't just read the book, you were supposed to type out and run all the code in the book, line by line. This helps reinforce the material, and I admit that it has been better than just passively reading the books. I have since gotten to the point where I feel comfortable with Python, well enough to make a living. But I've tried some other languages, “The Hard Way”, and in the end it feels like something is missing. C, Java, Scala, Rust - they've gone in one ear and out the other.
More recently, I found myself working through Rob Conery's "A Curious Moon" (an introduction to PostgreSQL using data from the Cassini mission) and the dbt “Jaffle Shop” tutorial at around the same time. I was dutifully copying all of the dbt commands, line by line. And yet I still just wasn't processing the material. I also just…don’t…care about jaffles.
Then, I had an idea - why not see if I could implement the code from A Curious Moon *inside* of dbt? Rob’s book had me working with space data (fun!), covered several things that the jaffle tutorial didn’t (such as creating indexes, foreign key relations, and functions), and just forced me to have to think from the perspective of “I want to do X, how do I do this in dbt?” and work from there. It was certainly more challenging, and there was a lot of Googling and Stack Overflowing my way around, but after doing this dbt just clicked for me in a way it hadn’t before.
If you want to try to learn a language (or framework or other tool...) - may I suggest try using a tutorial *for a language you already know*?
What does this give us?
There has been a fair amount of research into how people learn things, and one clear signal (see for example https://www.pnas.org/doi/pdf/10.1073/pnas.1319030111) is that active learning - where someone is forced to problem solve with knowledge they’ve learned - beats passive learning hands-down. My own experience reflects this - I have to struggle with whatever I’m working with to really internalize what's going on with a language. I can learn all I want about closures and inheritance and who knows what else, but unless I have some problem that I need to solve that is solved by that (whatever “that” may be), I find it hard to make a mental connection from the concept at hand to anything else.
However, it’s very easy to give yourself too much struggle. I can simply give myself some large project, and bang my head against the wall for hours to no effect. I need something that I can actually tackle.
Using a tutorial for a different language solves this issue. By design, they will pick a small-scoped project and will break it down into even smaller steps, letting me struggle with just one problem at a time - and often an easy to search problem at that. Instead of having to handle the dual cognitive load of "what are they doing?" and "how are they doing it in X?", I can more easily drop the first question and focus on the second.
Additionally, using the tutorial for an already-known language lets me use the fact that I have a much stronger mental map for my existing language than for the new one. If my Rust coding looks Pythonic then so be it - I can focus on fluency and learning particular language idioms later. My first goal is to just connect up the concepts for the new language with something I already have and build a real foundation.
Lastly, I hate to say it, but some tutorials are just plain bad. How am I to quickly evaluate the quality of a tutorial if I don't know what it's teaching? If I start with a tutorial for a language I know, I can often pick one that I know is good. Or perhaps the tutorial isn't strictly bad but for a use case that I just don't care about? There might not be a good scientific data tutorial for Rust I know of, but I can easily name two excellent Python ones I could use.
Closing thoughts
While the “Hard Way” books haven’t been as successful for me as I would have hoped, the central conceit of learning a language the hard way (if not “The Hard Way”) is a good one. The issue is simply that while explicitly typing in each line of code is harder than just reading a book, it still doesn’t put up enough resistance to help establish some new grooves in my mind. Starting with a simple tutorial and translating it, on the other hand, really forces me to have to pay attention to what I’m doing. I cannot simply disengage my brain and type, every step requires some active participation on my part. I hope this approach will help you struggle (productively) as well.
Paul Anzel had a misbegotten youth studying physics, but he's gone on to Data Engineering now. He volunteers with NumFOCUS and Tech for Campaigns, can play the accordion, and likes riding his bike.
Another reader, Lucian, wanted to share their own writing on taking snapshots of data with DBT that gives a good explanation of the mechanics of it:

If you'd like to share some writing like this guest post, a project, story, or anything else that might be interesting to the data community. Feel free to reach out to Randy with your idea.