Programming is just language.

Programming is just language.

September 2, 2009 2:59 pm 0 comments

My fall semester begins this week. I’m taking two courses: video field production and Ruby on Rails.

My first attempt to learn a non-markup programming language was horrifically painful. I was studying php and could build things that worked, but I didn’t know why I was writing the things I was writing, or why what worked worked, or why what didn’t work didn’t. This made troubleshooting (among other tasks) extremely difficult. I picked up enough of a feel to be able to read and nominally edit php, at least enough to fiddle confidently in the guts of WordPress templates.

So I’m understandably nervous about approaching Ruby. However, I feel like I have a secret weapon: a free, copyright-free pdf making its rounds of the internet, a brilliant book-length manual called Why’s (Poignant) Guide to Ruby. It uses Daniel-Handler-esque narrative wordplay, visual and verbal sketches, and comic strips starring cute cartoon foxes to instruct. It basically hits upon exactly how I best learn new information.

It also takes the science out of computer science. How I learn science is 100% about the teacher. My junior year of high school, I had a D+ in Mr. Robinson’s Honors Chemistry class. I was a true-blue humanities girl; science had never clicked. The only reason I was passing the course was because my best friend and lab partner was a S.T.E.M. genius. When we worked on lab reports, she did all of the math and science; I did all of the prose-writing and diagram-drawing. We were a really fantastic team. But I wasn’t learning chemistry. It was November, and I had no idea what a mole was. One day, the teacher cornered me. He wanted to know why I wasn’t learning anything. I told him that I was just bad at science and math. He told me that he bet that I was really good at geometry. That was, shockingly, true. I was always a low B/high C student in math classes, but I had earned straight As in geometry the year before, with a 98 average. That math teacher had publicly posted all of our test and homework scores, and I consistently ranked first or second in my whole grade. Stunned, I asked Mr. Robinson how he’d known that. Because I sometimes carried my art class portfolio in chemistry class. He explained that geometry is visual; it’s objects in space, it’s concrete. It’s close to art. He said that’s what chemistry is. I really needed that reframing. Once I was able to approach the problems in a way that I was comfortable problem-solving, everything fell into place. And I got an A in high school chemistry.

Mr. Robinson would never have let me get away with dropping my php class last year because “I’m a designer, not a programmer!”, especially since I was fully aware at the time of Paul Graham’s assertion that code is an expressive artist’s medium.

Why is a similar kind of a teacher to Mr. Robinson. He takes the science out of programming. He uses art as a vehicle for feeding it back, but what he actually says is: learning programming is about learning grammar. I’m a well-established grammar nerd. Art was the hook that I could hang chemistry on; language is where I’ll place programming. The reason I’m excited about Why’s instructional book is that, reading it, this is the first time I’ve ever been told: a variable is a noun; a constant is a proper noun; a method is a verb; an argument is an adverbial clause; a hash table is a dictionary. This is, very literally, language I understand. It’s computer programming as composing sentences rather than as constructing elaborate calculus problems. I can build sentences.

How I learn language is 100% about the resources I assemble. This is the same reason that I only really, really got German after picking up a book called English Grammar for Students of German. Read that title carefully. Note what it’s not. It’s not a book about German grammar. German grammar is crazy. The language is so close to English and has so many cognates that learning vocabulary words is a snap. But assembling them into workable sentences can be torturous. Not only are verbs conjugated, but nouns are declined. A personal pronoun that’s only one word (say, “you”) in English can be translated hundreds of ways into German, and very few ways — sometimes just one — are correct in a given statement. And not only do you have to match a pronoun to the gender of the noun (masculine, feminine, neuter), but also to the case of the noun (nominative, accusative, dative, genitive). In certain cases, both singular and plural nouns take endings, like conjugated verbs do. It can be overwhelming. This book re-teaches you English grammar, the things that were glossed over in — or forgotten since — elementary school. It teaches you the difference between transitive and intransitive verbs in English. It teaches you to distinguish six different types of adjectives in English. Being able to identify the direct object or the indirect object of a sentence is kind of a nonstarter in English, so teachers don’t really bother drilling that in. But it’s a really big deal in German sentence structure. Re-learning English, a language I was confident in my mastery of, through the prism of a language I was just learning, was an amazing experience.

And Ruby is English; learning the vocabulary will be a snap. If I want to be understood, if I want to successfully communicate in this language, I just have to get the grammar down cold. Ruby is just another crazily-grammar-intensive language to learn. But knowing the grammar is the key thing. That’s the reframing I need.

I’m on page 33 of Why’s (Poignant) Guide to Ruby. I already feel like I’ve learned twice as much about Ruby than I ever knew about php. And my Ruby class meets for the first time tomorrow. And I’m pretty confident I can master this.

Leave a reply