How Should I Teach a Basic Programming Course?
riverman writes "I have been 'provisioned' at the school where I work to teach a new Computer Science/Programming course. I'm supposed to be teaching everything from the very-very basics (i.e. where that myspace thing is in your computer monitor, and how it knows who your friends are) to the easy-advanced (i.e. PHP classes and Python/Google App Engine). I'm an experienced programmer, but I'm not sure where to start — I could easily assume that my students know something basic they don't. Are there any resources on the internet that could help me find a solid curriculum? What are your suggestions?"
I'm sure many of us have gone through intro-level programming courses of some sort; what are some things your teacher or professor did that worked well, and what didn't work at all?
Computer basics, ie how to use the web, and computer programming do not belong in the same course. People in the audience for either will not be happy with the other.
Don't teach things in 'the abstract'. Give them a task to accomplish that needs particular 'features'.
Then the next 'task' adds more 'features', but doesn't drop the earlier ones learned.
And don't make the tasks abstract either. "do a bubble sort" would qualify as too abstract. While "collect 5 client names from the user and sort them" wouldn't.
---- Booth was a patriot ----
Actually, the history of computers was one of the most interesting features of the Intro to Programming class I took the better part of a decade ago.
My instructor had worked for DEC and IBM maintaining big iron in the 70's and 80's, and he had a lot of extremely interesting stories, and a good deal of personal insight into computing history.
Of course, on the other hand, I'm now a graduate student in history, so I may not be particularly representative. YMMV.
Don't teach down. By this I mean please do not be shy about giving more complex examples. I had a professor who would constantly keep things very basic on purpose in order to not confuse people. The problem with that is that the top 10% get VERY bored and leave with questions unanswered while the bottom students (those who will go on to write inefficient insurance company database query code) still struggle to understand the difference between ++i and i++.
You should keep your advanced students in mind and nurture them. Do your part to help out our future.
The majority of people - even those with college degrees - have a difficult time with logic. Something as simple as an if-else construct can be very confusing to the average person at first.
And there's another twist. About 40% of learners can understand and manipulate abstract concepts, and learn them without any practical experience whatsoever. The other 60% require experiential learning - they have to do before they understand. Fortunately, computers can very easily demonstrate concepts such as if-else...
And how computers work is a mystery to most people. Before you start the course, you should come up with a simple mental model that you can use to explain how a computer works to someone with absolutely no understanding of electronics, logic, etc... For a basic programming course, you should first assess class understanding:
For most programming courses, you should not even assume your students understand how to use the compiler. Furthermore, you should probably come up with a series of simple examples which demonstrate your point without any extraneous code. Because most people learn by doing, one of the first exercises should be to build a simple "hello world" type of application to familiarize themselves with the build tools.
And have fun! Come up with interesting problems. Your students will most likely spend most of their corporate careers doing boring stuff, so they'll appreciate the chance to do fun things like games.
The society for a thought-free internet welcomes you.
Kids taking an introductory computer course generally are not reading slashdot...
That is why we are nerds, we like stuff that bores other people to tears...
Once you are old enough to realize this, you will function better in the world at large.
Be very, very careful what you put into that head, because you will never, ever get it out. - Cardinal Wolsey
Focusing on pseudocode might be fine in college - but in HS it is very important to start with topics that are actually motivating the students. The danger is that you lose 80% of your students on the way if you do not give them "something to play with" every once in a while.
Basic will harm their minds less than C. I say teach them python.
I remember a story about a teacher that did something similar. He brought in the making for a peanut butter and jelly sandwich. He then asked the class for instructions on how to make it. It went as follows.
1. "Put the peanut butter on the slice of bread."
He held the jar over the slice of bread and started to shake the jar.
2. ""No you take the knife and use it to spread the peanut jelly"
He started to grab the knife by the blade end.
3. "No grab the knife by the other end."
This time he holds the knife correctly.
4. "Spread the peanut butter on the slice of bread"
He starts to put the peanut butter on the edges of the bread.
This went on in minute detail until it dawned on the students that in everyday speech, we leave a lot out assuming that everyone knows what we are talking about. The students got an understanding of how we must communicate with computers. This in turn opened the discussion to other topics.
x = x + 1
x/x = (x+1)/x
1 = x/x + 1/x
1 = 1 + 1/x
0/1 = 1/x
0*x = 1
x = 1/0 = infinity.
Start with logical thinking... Don't root yourself in any particular language.. Teach algorithms in a step by step manner.. Also give a good intro on what programming is good for... i.e. the applications in real life.. show where the value is for the student to learn programming..
When I was in 6th grade, computer class used Apple II's and we learned out of the Kids and the Apple II book, which took us through the basic language from the ground level and, looking back, I think it did a decent job of teaching us programming concepts in a fun way. I think this background gave me a good foundation of programming that helped me even through college C++ classes.
But I'm not writing to specifically recommend that book, but to share my observation about that time period of learning. Sure, we had our share of boring calculator programs, and I wrote a fair amount of spaghetti code, but the most fun we had was when the teacher assigned us to write an adventure game, in the vein of choose your own adventure. Since textual and graphical adventure games were what we liked to play at the time, it was a real thrill to be able to try to create even a pale imitation of them.
But then things got too complicated. Games got to good so it wasn't really possible to imitate them on a low level. If you learned C or C++ in class, it was really difficult to create games or GUI apps without learning all these other tools and platforms. Programs had to be compiled and took all the immediacy out of trial and error programming.
Years later, when the web came along and everybody was hand-coding or frontpage-ing static HTML pages for their "homepages," I never got into that. I knew that the professionally done sites like yahoo or amazon weren't using static HTML but had server generated pages. When PHP finally came around with the ability to programmatically generate web pages, I felt a thrill just like back in the BASIC adventure game days. I could create media the same way those "in power" created it.
Today's kids are voracious consumers of media, but they like to create it too. Whenever tools come along that let them create media "just like the pros," they jump on it. For example, when CD burners came around, everybody made mix-CD's just like the compilation CDs sold commercially. When sound and video editing came out, kids jumped on that, first using DVD burners and then YouTube.
Following this observation, kids nowdays live on the web. To them, Facebook is professional media. If they could create dynamic sites like Facebook, they would feel the thrill of creative programming and be able to connect with the reason for why people program computers.
For this reason, I think one of the web-oriented languages like PHP or Ruby is a great way to introduce programming to students. They can build pages like what they use and see the results in their web browser immediately without compiling and feel the thrill of creating again.