Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

How Should I Teach a Basic Programming Course?

Posted by Soulskill on Saturday October 11, @10:48AM
from the week-one:-beards dept.
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?
ruby python java askslashdot programming
askslashdot programming
story

Related Stories

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by Anonymous Coward on Saturday October 11, @10:50AM (#25339257)

    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.

    • by Anonymous Coward on Saturday October 11, @12:22PM (#25339929)

      What grade level is this on? If it's a semester long high school course, or middle school, you should get up with an experienced teacher. Even if you're teaching this at a junior/university college, you should find a licensed educator to talk to. Too often computer science teachers know a bit about programming and logic, but very little about teaching. I'ld recommend covering your major points, and focus on a very VERY simplistic program that handles a few basic aspects (Perhaps a simple calculator?) and progress through whatever technologies are necessary while stressing that programming languages are like human languages, except machine friendly. Some languages are more flowery (latin) some are more coarse (germanic) and some are very powerfully in their succinctness (some asiatics).. Finding a way to bring this out of nerd land helps normal kids not want to get you fired as badly.

      1) teach background
      2) teach theory
      3) relate theory to something understandable
      4) expound. Verify learning, and repeat. And repeat. and repeat. then move on seems to work. Half the kids are not paying attention at any given time in virtually any class.

        • by Alex Belits (437) * on Saturday October 11, @02:09PM (#25340671) Homepage

          At first I thought to ridicule your notion that rank beginners should be taught software engineering theory.

          BAD software engineering theory, to boot.

          Just imagine test-driven aerospace engineering. Test-driven civil engineering. Test-driven economics (okay, I take it back, that's Libertarian idea of letting everyone build "free market" by trial and error and not get wiped out or enslaved in the process). Test-driven medicine. All those area use massive amount of experiments, observation and verification, yet none would find it acceptable to abandon theory, rig up some testing contraption that may or may not be mis-designed and buggy by itself, then do job half-assedly and introduce random changes until tests pass. Or at least this is how "test-driven development" is usually implemented.

          I know one area where test-driven development worked extremey well -- biological evolution. Enjoy your ten million years long development cycles. And cancer. I mean, in products of such development.

  • by nurb432 (527695) on Saturday October 11, @10:51AM (#25339261) Homepage Journal

    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.

    • by introspekt.i (1233118) on Saturday October 11, @11:05AM (#25339369)
      Second that motion. I teach labs for an introductory programming class myself. The best way to get concepts to stick with students is to present them as pertinent problems or tasks to the students. Some examples that work for me are making small games (card games, dice games, etc) and writing programs that perform some kind of pertinent calculation (like business calculations or health BMI, target heart rate) calculations. All of these can be encapsulated in the task of presenting the program to the user in a nice interface..be it command line, web, or desktop GUI.

      These examples don't cover everything, but what you do should work for you, your students, and the concept that needs to be transferred to the students.
      • by bishiraver (707931) on Saturday October 11, @12:03PM (#25339799) Homepage

        This isn't just for programming. Using pertinent tasks to teach any subject is the best way to get the knowledge to stick.

          • by Alex Belits (437) * on Saturday October 11, @02:16PM (#25340727) Homepage

            (Considering I'm almost 30, I program computers for a good living, and I've never used it, I'm thinking: it ain't.)

            Considering I'm almost 40, I program computers for a living and have to use it all the time, I am thinking you are a some kind of web developer.

                • by Blakey Rat (99501) on Saturday October 11, @10:01PM (#25343079)

                  I'm not ignorance of basic math, I'm ignorance of calculus. And I'm not proud (or ashamed, really) of it at all.

                  Look, here's the reason I posted that: I was part of a CS program at a university that required calculus. I failed calculus more than once (go ahead, make fun of me), and as a result I ended up dropping out of the program and feeling terrible for years. I'd go as far as saying it wasted years of my life working a dead-end support job.

                  Imagine how I felt after learning that, hey, calculus is actually mostly useless for the vast majority of software development jobs. Universities are losing students by making pointless requirements that have nothing to do with the field the students are studying, and I think that should stop. That's all.

    • by Vindication (1383017) on Saturday October 11, @11:28AM (#25339543)

      I'm a high school student who has previously taken AP-A Computer Science and is currently taking AB CS (this is the last year they're offering it, I believe), and I have never been more dissatisfied with any teacher that I have ever had.

      Programming is an outside interest for me; while we do Java in class, I experiment around with C, C++ and Python outside of school (and I am planning on trying to pick up PHP and Perl soon). I've found that many of my classmates, including friends who I know are quite competent with computers in general, are quite lost when trying to learn or apply many of the concepts we use in CS.This is understandable. However, my teacher has inexplicably continued to introduce many of these abstract concepts at the same time, without really explaining even the basic purpose and logic behind each one. As a result, I've seen many people new to CS but genuinely interested in it just give up, because it made little sense to them. Personally, I know someone who is quite talented with C, and it is thanks to his help that I can understand basic C concepts (memory management, etc.) and not be overwhelmed. This friend of mine, I believe, is quite a good teacher, and this is largely due to the fact that he a) does not assume that I know things incredibly well and b) utilizes the Socratic method to great effect.

      I agree with the parent's comment. Our current project in AB CS is to write a program that sorts an array using several different algorithms. It is supposed to help us understand Big O notation and the logic behind writing more efficient algorithms, but the teacher hasn't said a single word about Big O, instead opting to hand out papers (which my friends have told me they don't understand at all). The concept of Big O notation seems to be too abstract without practical examples.

      Encourage asking questions...you'd be surprised at how many people are afraid of asking questions because they feel they will sound stupid (at least in high school).

      Pseudocode is a necessity for some of the assignments we have, and yet many of my friends fail to see the point (they just see it as a waste of time). Make sure to emphasize its importance, because they will feel that they do not need it early on.

      Also, make sure to emphasize the importance of debugging your own code early and often. Since my "teacher" does not actually teach, I often end up having to help out my friends who are absolutely stuck, only to find that they had a small debugging issue that they could not find because the teacher never bothered explaining the necessity of debugging.

      I don't claim to be an expert in CS or teaching whatsoever, so take this response with a grain of salt. However, I do like to think that my experiences in these courses lend at least some credibility to my reply.

    • by hedronist (233240) * on Saturday October 11, @11:48AM (#25339687)
      I agree, go concrete. It's easy to forget that almost everything about a computer is abstract to a rank beginner. One thing I have seen students get hung up on is:

      x = x + 1

      It looks like an equality statement that couldn't possibly be correct. Just telling them it's "an assignment statement" doesn't seem to penetrate. I have found a mailbox analogy to work about 95% of the time.

      It goes like this: You are at the post office in front of a wall of mailboxes. The mailboxes have numbers on them (you could go into memory addressing if it was appropriate, but it's probably best to leave that out unless someone asks for a little more detail). One of the boxes has a label on it: 'x'. The statement "x = x + 1" means "take the current contents of the box labeled 'x', add '1' to it, then put the result back in the box labeled 'x'"

      Often, about 60% of the students immediately go, "Oh. That's pretty straightforward." For the remainder, you could have 4 or 5 cardboard boxes. Write 'x' on a sticky note and put it on a box. Write '1' on a piece of paper ... You get the idea. Seeing this very concrete representation of memory, and that the names are 'labels' on that memory, means that this thing they have been hearing about for years, 'memory', is now nothing but a bunch of boxes you can store stuff in. Simple.

      You can elaborate on this by putting multiple labels on the same box, or putting special pieces of paper in some boxes that say 'don't use me, go get/set the value of some other box', thereby demonstrating pointers. You can also demonstrate type mismatches by putting a picture in a box and then ask a student what it means to 'add 1 to a picture'. Etc, etc.

      This may sound like baby steps, but in 1/2 hour or less and you have given your students a real, usable model of one of the most fundamental concepts there is.

  • Teach them fun... (Score:5, Interesting)

    by SerpentMage (13390) <ChristianHGross AT yahoo DOT ca> on Saturday October 11, @10:56AM (#25339301)

    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.

      • Re:Teach them fun... (Score:5, Interesting)

        by xenocide2 (231786) on Saturday October 11, @12:19PM (#25339913) Homepage

        Computer Science Unplugged [csunplugged.org] is a curriculum out there designed to teach students computing principles, and they recommend a game [csunplugged.org] like that. The game works like this: one person is playing the role of "programmer" and the rest of the class will try to follow their instructions. The goal is to duplicate a drawing that only the programmer can see.

        The first game(s) the rules are easy -- the "computer" can ask questions and the class can see what the machine is doing. Then you introduce restrictions. The computer player will be restricted from speaking, for example. At the end you have the programmer obscured from the class, only able to speak to their classmates to describe a picture. As programmers we rarely get the "full picture" so to speak, and have to give precise instructions that both we and the computer understand identically.

        The most important challenge to this as a teacher is selecting appropriate examples. They have a few, but I'd also add: a formula, with exponents, parenthesis, variables and subscripts. A pixel art smilely face ala CSS testing. A curve. A full binary tree with 4 levels. A small section of text, with bold, underline, paragraphs and bulletpoints. These are harder, but high school students can do it and it illustrates both rendering techniques and the need for language. For highschool students, I'd suggest spending a class on this, and then asking them to either write a paper (1 page tops) on the significance, or if the class is fast and small enough, hold a discussion.

  • by Anonymous Coward on Saturday October 11, @10:57AM (#25339307)

    ...my first class in programming: the teacher wrote "x=x+1" on the blackboard, and my reaction was "Huh? That is unsolvable!"

  • Blender! (Score:4, Interesting)

    by saterdaies (842986) on Saturday October 11, @10:58AM (#25339313)

    So, one of my friends in college did his senior research on alternative ways to teach introduction to programming and gave a very convincing argument for teaching it with Python and Blender (the 3D content creator). Blender allows you to use the Python programming language to set everything up and manipulate the objects so they learn programming, but it's a lot more satisfying. For example, what's more fun: reading input from stdin and saying if that integer is divisible by 3 using % or creating some 3D objects and moving them across the screen in a specified way?

    Maybe someone else has a better idea, but I thought I'd share

    • Re:Blender! (Score:5, Informative)

      by baxissimo (135512) on Saturday October 11, @11:52AM (#25339719)

      If you're going to go this route, Alice [alice.org] 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.)

  • by dummy_variable (35218) on Saturday October 11, @10:59AM (#25339319)

    This was a recent topic [stackoverflow.com] on stackoverflow. There are some really good suggestions there.

  • Steve Drasner (Score:5, Informative)

    by gcnaddict (841664) <gcnaddict.gmail@com> on Saturday October 11, @11:01AM (#25339331) Homepage
    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/ [nvcc.edu]
  • by TarrVetus (597895) <TarrVetus@ g m a i l . com> on Saturday October 11, @11:02AM (#25339341)
    You could check the Stanford Engineering Everywhere program's resources [stanford.edu]. They released some great beginner level programming courses [stanford.edu] under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license [creativecommons.org]. Those could be adapted for teaching the subject to students, and the content used for instructional material.
  • by ricegf (1059658) on Saturday October 11, @11:02AM (#25339343) Journal
    I attended a fascinating talk by Mr. Vern Ceder [canterburyschool.org] at the past PyCon (Python Conference) on teaching programming to secondary students. You might review his papers from that and other conferences, and email him for advice (see linked page).
  • by VikingBerserker (546589) on Saturday October 11, @11:12AM (#25339427)

    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.

    • by wfstanle (1188751) on Saturday October 11, @12:03PM (#25339807)

      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.

  • 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:

    1. Do they know how a computer works at a basic level - files, memory, cpu, etc?
    2. Do they know the difference between an application, and the files it creates ("I saved it in Word..." etc..)
    3. Do they understand how to solve a problem by breaking it down into its constituent steps? Believe me, there are people that really struggle with this, and expect the instructor just to teach them to solve a particular problem, rather than how to instruct a computer to solve problems. In fact, that might be a good introduction to programming, "Computer programming is the art of instructing computers to solve problems."

    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.

  • by eddy (18759) on Saturday October 11, @11:20AM (#25339479) Homepage Journal

    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 [mdx.ac.uk]

    Learning to program is notoriously difficult. A substantial minority of students fails in every introductory programming course in every UK university. Despite heroic academic effort, the proportion has increased rather than decreased over the years. Despite a great deal of research into teaching methods and student responses, we have no idea of the cause.

    It has long been suspected that some people have a natural aptitude for programming, but until now there has been no psychological test which could detect it. Programming ability is not known to be correlated with age, with sex, or with educational attainment; nor has it been found to be correlated with any of the aptitudes measured in conventional intelligence or problem-solving-ability tests.

    We have found a test for programming aptitude, of which we give details. We can predict success or failure even before students have had any contact with any programming language with very high accuracy, and by testing with the same instrument after a few weeks of exposure, with extreme accuracy. We present experimental evidence to support our claim. We point out that programming teaching is useless for those who are bound to fail and pointless for those who are certain to succeed.

  • by Lennie (16154) on Saturday October 11, @02:13PM (#25340703) Homepage

    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/ [mit.edu]

    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).