I didn't touch my first programming language until I was 23 years old. A decade prior, I had started learning my first world language. I would go on to find that language-learning is a matter of understanding a complex system. It's only easy if you understand how the pieces fit together to form the whole. Once you see the patterns that make the system work, the individual pieces just "click" together.
I spent 6 years of classroom time studying Spanish and 100 days living in Spain practicing it with native speakers. I spent another 4 semesters learning Japanese. I strongly believe that programming languages have a lot in common with world languages, and that's what I'd like to share here in case it might benefit a struggling student.
In Spanish, things didn't make sense as much until we got to conjugating verbs. Nobody likes those verb tables, except apparently me. If you took a language class, you'll know what this is:
For the verb:
- Infinitive (escribir = to write) is a regular -ir infinitive, and those have their own rules
- Conjugation needs to match correct person (1st, 2nd, 3rd)
- Conjugation needs to match correct quantity (singular, plural)
- Word needs to go in the correct place for a verb within the sentence
- The 'r' needs to be a "tap" r sound if you want native pronunciation, and the vowels need to be the Spanish "e" and "i" sounds
For the console logging function:
- console.log() takes an argument
- That argument can be any object
- Object needs to compile to the thing you're trying to display
- This function needs to go after the object you're trying to display or it won't know what object you're referring to
- Semicolon is optional, lowercase, parentheses, and period are all required
As you can see, if you follow all of these rules, you will have a high chance of success communicating your message.
What intimidates students who are new to world languages or programming languages is actually the same thing. Except for the unfair misconception that you need to be a math wiz to be good at programming, the primary concern is the complexity.
Sure, the idea of talking to strangers comes exclusively to world languages, and you might not like it when a computer throws an error at you, but ultimately those could be tolerable if we knew we had a guarantee that we'd reach an understanding of the language at some point. People are willing to tolerate a certain amount of struggle if they know there is a reward coming at the end.
Complexity doesn't have to be a bad thing, though. Complexity is good because it means we won't be limited by what we can do with the language. We need our languages to be complex in order to build messages and systems that are capable of accomplishing complex tasks. Understanding that complexity and internalizing the rulebook is simply the responsibility of someone who wants to wield the power that complexity has to offer, and it is very manageable, even if time-consuming.
These are my recommendations for a student who wants to approach programming languages like I approach all the languages I want to learn:
- Gather your fundamental building blocks and study the rules for using them
- Seek and take note of patterns, attempt to recreate these patterns in new situations
- Fail fast, fail early --> learning what doesn't work is just as important as learning what does work
- Don't focus on memorizing individual pieces and phrases so much --> if you can rely on a pattern to remind you of parts of the language, remember the pattern instead. You want to be able to generate new language that works, not be reliant on memorized phrases that worked in the past
- Give yourself time --> if you rush, you risk taking shortcuts. Internalizing long-term gratification will set you up for success and allow the process to be fun
I hope this makes sense. Language-learning is a lifelong passion of mine, and I don't draw a distinction between programming languages and world languages. They are all systems with rules that serve a purpose. Our job is to become adept at using those systems to solve real-world problems.
Go learn that language and start solving some problems!