Rookies at Work, Part 1: The best way to learn code… write code!
Et voilà: My series dedicated to computer literacy is ready to take off. In my first blog post on this topic, “I’m On My Way to Computer Literacy: Care to join me?” I asked readers which name they like most — “Fumble & Pride,” “It’s Not Rocket Science” or “Rookies at Work.” I received positive feedback on the third title (which is my favorite, too). Let’s hear a big round of applause for the winner — “Rookies at Work”! (I started designing a logo for it, which I’ll present in a later post.)
That first-of-a-series blog sparked a conversation (that’s what blogging should do) with a small group of experienced developers at Twitter. Among them was a young Polish team from Netguru, who even offered me an internship under two conditions: 1) I must learn some basics of the Ruby programming language and, 2) I’m expected to work for free. (Seriously, I think it would be fun with these guys. Instead of going on holiday and wasting time at the seashore, I’d be...)
To help me get started, they provided two sources: tryruby.org and railsforzombies.org. I now have some initial Ruby takeaways to share.
First, Ruby feels different. The creators of both sites say it’s the “programming language of Generation Nintendo.” It’s fun, witty, unpretentious and comes with a geeky sense of humor I like a lot. Although I didn’t dig too deep into it, I immediately sensed Ruby is a completely different habitat than Microsoft.NET Framework, which I’m mainly focused on.
Learn through imitation and repetition.
Understanding comes with time.
Unless you’re an Einstein (which I’m definitely not), you simply won’t understand the concept of a programming language when you’re an absolute beginner. “What is a class?” “What is a method?” “Wait a minute… what about strings?” As a newbie, you’re entering a land of confusion. You have to use rounded and square brackets (which are rarely used when writing emails, presentations and such), and type in strange command lines that look as if they were invented by aliens — poem_lines.to_a.reverse… Yes, it’s called coding.
Take my advice: Don’t even try to understand it. There are loads of friendly people out there providing tutorials, blogs and books. Confusion is inevitable in the beginning — no matter how much you stretch your imagination and try to grasp the concept of a given programming language — unless you follow my ridiculously simple, but highly effective advice:
Take coding courses without thinking and trying to understand.
You’ve probably seen a movie where the captain of a huge airplane with hundreds on board suffers a heart attack or similar fate. All of a sudden, the cockpit is orphaned. A brave passenger with zero flight experience steps forward and lands the plane safely, simply by following commands from the ground crew. That’s how I learn coding and I recommend you test my method. Here’s why: You get a lot of satisfaction from accomplishing a task, regardless of how you do it — even if you just type what the course instructions tell you, line by line.
But let’s get back to the movie analogy. If the ground crew starts explaining the basics of thermodynamics to the newly minted captain, all the passengers would be doomed, because as a beginner, you can’t understand thermodynamics in only a few minutes (again, assuming you’re no Einstein). By simply following commands without thinking about them, all the passengers have a chance at survival.
“Press the green button! What do you see on the screen now?”
“A ‘WHEELS READY TO GET OUT’ message.”
“Great! Now grab the control stick and press the blue button on the left…”
After a shaky but safe landing, the rookie pilot receives applause from the rescued passengers and wins the heart of the beautiful stewardess. That’s how life should be!
Now, let’s assume our hero is faced with the same situation over and over again. Each time he boards a plane, something dreadful happens to the captain and he must land the aircraft and save the passengers. Over time, he’ll start to understand the tasks he’s asked to perform by the ground crew. “Hmm, when I pull the control stick too much, the plane rises and goes faster, instead of slowing down.” One day, he reads about thermodynamics and starts to understand flying based on his vast practical experience.
It’s no different with learning programming languages. It might sound a bit foolish, but walk through as many tutorials as you can by mindlessly retyping the code provided. The more you type, the more familiar you become with the language and, over time, start to understand what you’re doing. That’s how we all learn most things— whether walking, talking, interacting with others or riding a bicycle. Did your mom or dad teach you how to ride a bike by explaining the laws of physics? Hell, no! You were asked to hold the steering rod with your hands and pedal with your feet. And although you didn’t understand what you where doing, after a while, you learned how to bicycle. Remember how proud you were?
As adults, we assume we can understand something in theory before we start exploring the subject in practice (if at all). What a waste of time! That’s the best way to become a Jack-of-all-trades, master of none.
The biggest challenge?
Hack! Mistyping code.
Another challenge — even greater than understanding a programming language — is the typing itself. As I said, when writing code for the first time, you use tokens you can barely find on the keyboard, such as {} or [] or ||. Even if you just type in the code from the lesson you’re working on without trying to understand it (as I advise you to do), you’ll mistype code. How to overcome this obstacle? By typing as much code as possible. The more you type and become familiar with the strange vocabulary of a programming language, the fewer mistakes you make and eventually begin to get it. “Wait a sec… shouldn’t I end every line with a semicolon? That’s it! That’s why I’m getting an error message.” It’s as simple as that. Not rocket science at all.
P.S.: I hope you’re not discouraged to join my journey towards computer literacy. For me, it’s pure fun. I believe you’ll experience first-time coding in a similar way — if you don’t try to understand, but instead put your trust in the power of imitation and repetition. Over time, it will get you to the point of comprehension. Enjoy!