Learn Python like it’s French
Confession: I haven’t actually learned French. I have learned Hungarian, but “Learn Python like it’s Hungarian” would’ve been a less slick title. Close enough.
A couple of weeks ago I decided that I ought to learn Python and thought, hey why don’t I try to apply some of my language-learning Secret Pro Techniques! I’m already fluent in a couple other scripting languages which means that much like when learning to speak a second language, I don’t need to learn how to program, merely how to express myself in an unfamiliar syntactic and semantic environment.
Technique | Hungarian | Python |
---|---|---|
Step 0: Prime your brain to learn a new language |
Learn the alphabet and all the sounds. Practice sounding out some words | Skim the Tutorial |
Step 1: Map the most common symbols back to the language you already know |
I made flashcards for the 200 most commonly spoken words in Hungarian (words like “the” and “also”) and mapped them to their closest English counterparts | I made flashcards for the most salient language features, mapped to their closest JavaScript/Ruby counterparts |
Step 2.a: Figure out how you want to get value from the language and start imitating that context. Spend the majority of your time doing this |
I wanted to learn Hungarian for casual use while traveling, so I hired a tutor on italki and we role-played simple scenarios like buying food from a supermarket | I intend to use Python for writing multi-threaded programs, so I wrote a very simple web crawler |
Step 2.b: Keep track of and review your mistakes. Don’t use someone else’s flashcards. When you make your own flashcard you forge a special bond with it |
Whenever I made a grammatical mistake or didn’t know a word, I’d ask my tutor to write it down. After the lesson each item became a flashcard | After each toy program I wrote, I’d review my code and look at my search history to find knowledge gaps. Each faux pas, mistake, or search became (you guessed it) a flashcard |
Step 3: Branch out! You can’t master a compound exercise like deadlifts by doing just deadlifts, forever. You have to mix in some accessory movements. Surprise weightlifting analogy! |
I found several small ways to work Hungarian into my daily life from different angles. I labeled all the objects in my apartment. I started listening to Hungarian music. I started speaking with my grandmother in Hungarian. I subscribed to r/hungary (not recommended). | I read the source code for some popular Python packages (e.g. requests). I asked my friends for their best Python trivia. I solved some classic programming programming problems on leetcode |
Bonus Step: Have Fun! |
Go to a local Hungarian deli and introduce yourself to the owner! Join a language exchange discord server! Write terrible poetry! | Challenge a friend to a round of code golf! Solve a string parsing problem on leetcode using machine learning! Write a quine! |
Am I pushing the limits of the analogy between spoken languages and programming languages? Probably! Still, I think this framework was helpful in getting me to to a reasonable degree of comfort with in Python in only a couple of weeks. If you have any super cool language learning pro tips, please share them!