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 ----
1) Teach them to understand that a computer does what a computer is told. So as a class building exercise get them to "program" a robot in pseudo code. You give them a fairly complex assignment that involves decisions. The test in this is that you the teacher are the robot. And the students who thought of this as a joke or simple assignment will quickly realize that garbage in garbage out means something.
2) Do the assignment again, but this time add "testing" routines. Make them write little assignments, that are assembled into bigger tasks. Show how this could be a "test driven" environment. You teach the robot little things, and then those things are assembled into bigger things. This teaches them components, modules and test driven.
3) Take all of that knowledge and apply it to a programming language. I personally would choose something along the lines of python and ruby. They have enough problems and they need a quick turn around.
4) Teach them about OO by introducing them to a programming language like C# or Java.
5) Finally teach them functional
Though I would stress team exercises thus giving them the benefit of XP (Extreme Programming) type training.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
...my first class in programming: the teacher wrote "x=x+1" on the blackboard, and my reaction was "Huh? That is unsolvable!"
This was a recent topic on stackoverflow. There are some really good suggestions there.
Find Steve Drasner. He's a Computer Science professor at Northern Virginia Community College in Annandale.
His intro to programming class starts at the bottom, teaching only pseudocode without the use of computers whatsoever. After giving the students a good grasp of concepts of structured programming, he uses it to segue into the concepts of object oriented programming.
I took Java prior to Drasner's class and, while I understood most of what I learned, I never quite understood the purpose of OOP/D until I took Drasner's course. Everything snapped into place.
http://www.nvcc.edu/home/sdrasner/
Viable Slashdot alternatives: https://pipedot.org/ and http://soylentnews.org/
You could check the Stanford Engineering Everywhere program's resources. They released some great beginner level programming courses under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license. Those could be adapted for teaching the subject to students, and the content used for instructional material.
When I first learned to program, I remember the teacher asking us how we got to school that day, in as minute details as possible. Example: awaken, open eyes, elevate torso, rotate 90 degrees, bend legs until they reach the floor, stand, walk to bathroom, etc.
From there, you can explain the concepts of procedures to compartmentalize the code. Brushing your teeth may take thousands of steps, yet cut down dramatically with looping, etc.
While it starts out as a new way of looking at how computers process the steps in a more methodical sense than we do, it soon becomes a way to introduce functions, procedures, and other syntax in a practical sense.
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.
As a starting point, I suggest this (draft) paper, because it's interesting, and short, flippant, and gets you thinking. The Camel has Two Humps
Belief is the currency of delusion.
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
If you're going to go this route, Alice is probably a better choice, since it was basically designed as a tool to teach programming with 3D graphics.
As opposed to Blender, which well, wasn't actually designed at all. :-P
(kidding -- Blender is great, but as a way to teach programming... the phrase "now you've got TWO problems" comes to mind.)
Maybe now that you are in teaching, maybe you should have a look how others do it, here is an example:
http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
I've been watching these for a while now, I liked them (although to much beginner for me, it's a nice way to get to know a 'new' language).
New things are always on the horizon