New programmers are never sure what it “takes” to learn a programming language. This is not helped by the quantity of “Learn x language in 24 hours/3 days/etc.!” books that are out there, and by the overabundance of technical information available.
So what I propose is an analogy.
You might think that the analogy I would make would compare learning a programming language to learning a foreign language (e. g. Spanish.) But after much deliberation, I don’t think that’s a valid for several reasons:
- Foreign languages are almost always more complex than programming languages. Something like French has evolved for the past two millenia, while even ‘old’ programming languages have only been around for 50 years. Furthermore, French has the task of concisely communicating any conceivable expression to another human, while C/Java/Delphi only has to boss around some chunks of metal and silicon.
- You must memorize every aspect of a foreign language, while with programming languages you have the all-powerful documentation to help you with some of the less common things.
- Even if you know that “Hello” is the most common greeting in English, you’ll sound dumb if you don’t use “Hi”, “Hey”, and “What’s up?” in the right circumstances. Meanwhile, BASIC will always think “10 PRINT “HELLO, WORLD!” is the best way of doing things.
- Similar to the first one, foreign languages have a MUCH bigger vocabulary to learn than programming languages.
So I really don’t think it’s a valid comparison.
What I consider more vaild is comparing programming languages to musical instruments. First, let’s think about a story about little Billy.
Little Billy decided one morning that, since he really like music, he wanted to learn to play a musical instrument, so he could make his own music. He went to the music store, and was initially awed by the sheer quantity of different types of instruments for sale. After much inner turmoil, he decided to use the piano, since it was common, rationalizing his choice by thinking, “Since so many people use it, it must be one of the best choices. There’ll also be more people who can help me. Finally, it sounds good.” While he was in the music store, he also picked up a tutorial on learning how to play the piano.
He went home, and did a chapter of the book per day, being sure to actually play the piano as much as possible. By the time he finished working through the book, he was a decent piano player, but still had a lot to learn. He kept playing, hired a teacher, and within a few years he was downright adept.
Now consider little Billy’s brother–Tom.
Tom decided one morning that, since he really like computers, he wanted to learn to program, so he could make his own programs. He went online, and was initially awed by the sheer quantity of different types of programming languages available. After much inner turmoil, he decided to use Python, since it was common, rationalizing his choice by thinking, “Since so many people use it, it must be one of the best choices. There’ll also be more people who can help me. Finally, the syntax looks good.” While he was online, he also picked up a tutorial on programming in Python.
He went home, and did a chapter of the tutorial per day, being sure to actually do the programs as much as possible. By the time he finished working through the tutorial, he was a decent programmer, but still had a lot to learn. He kept programming, started working on projects so he could learn from the project chief, and within a few years he was downright adept.
Now that you know where I’m going with this, I can fill in some details:
They both give you ‘instant success.’ Anybody, and I mean anybody, can either make his computer say “Hello World!”, or play a few notes on an instrument within ten minutes.
They both have specific technique. Java programmers know that using a variable without declaring it first is a big no-no. Trumpet players will fail if they just move their fingers–and don’t blow. Another way of saying this is that they both teach through failure–be it a bad sound or a segfault.
They both provide gratification. People get really excited when they play a tune well, or solve a particularly sticky programming problem.
If you do something again, you’ll do it better When an elementary school band plays “The Star-Spangled Banner”, it is very apparent that it’s not the New York Philharmonic playing “The Star-Spanled Banner.” A first-year programmer will use a very different method for solving a problem when compared to an old-hand.
So if you’ve ever learned how to play an instrument, you’re primed for programming. And if you’ve ever programmed, you know what it takes to play an instrument.
——-
I’m kind of interested in the reception this is going to get–please let me know what you think!