Monday, July 5, 2010

C programming

I used to teach C programming, among other classes, at a state college. My total load was 12 credit hours per semester, so maybe I couldn't spend as much time as I would have liked, but for some of the kids no amount of my time would have been sufficient. Knowing how to program in C was absolutely required for the rest of the courses in the computer science major. So I did my best to make the students learn C programming. I gave them lectures. I had lab sessions where I helped them with their programs. I totally held their hands and spoon fed them C programming.

Then there were exams. I insisted that the students demonstrate their mastery of C by writing small C programs and program fragments on their exams. All too many of them couldn't do it. It wasn't because they weren't capable of it, but rather because they didn't study. I wouldn't have gotten their weekly programs turned in if it wasn't a policy that no one would get a passing grade without turning in all the homeworks. Learning to program requires a lot of practice and these kids weren't willing to put the time in to get the practice, so they failed the exams.

Except that you can't fail the entire class on the exams. So I had to give partial credit, bonus points, whatever, to raise the class's average grade to a C. Once they realized that was what I was doing, there was no trying to get them to study for the exams. So a bunch of kids passed my class still unable to sit down and write a computer program. I might mention that very few students from that university get jobs as computer programmers, but one of them might be administrating your computers as we speak.

11 comments:

  1. Why couldn't you fail the entire class on an exam? If you did it once, it might shock them into studying for the next one.

    (Although I think I can answer this myself: if you failed them all on an exam, they'd go complaining to the Dean/Department Chair that your class was impossible and you must be a horrible teacher if everyone failed!)

    ReplyDelete
  2. I hear you. I've got a course that *should* conclude with students knowing how to do basic scripting in Flash. Next to no one will put in the time to struggle with it enough to gain ANY competency. I can barely get them to do the spoon-fed tutorials. But most people pass. Why? Because I'm still 3 years from tenure. Once I've got tenure, let me tell you, the hammer is going to fall.

    ReplyDelete
  3. When you quit teaching, I hope you told your department, and the university, why. It's impossible to teach where you can't honestly evaluate the work.

    ReplyDelete
  4. I'm a department chair in mathematics at a state university, and I am prepared to back up my faculty, provided that they are doing their jobs. This means not passing students who shouldn't.

    ReplyDelete
  5. Programming aptitude might be more of a personality trait than a skill that can be taught. Not everyone can become a good programmer just by trying. But it sounds like these students weren't even trying, probably because programming is kind of hard and if your interest in it is marginal at best, then you will never pick it up. Sounds like most of these students should not be CS majors. A lot of kids are tricked into thinking that if they like games and are good with computers, i.e., using computers, then they will excel in a CS program. Actually a good mathematician with no computer skills whatsover is a better candidate that someone who spends hours playing computer games. It's time academia recognized computer science as a sub-discipline of mathematics rather than treating it like a particularly difficult branch of information systems.

    ReplyDelete
  6. I too am distressed by how so few of my physics majors can program, or feel any need to learn how. Without question, it is what most limits their usefulness to me in research. That said, are you sure the fault is entirely that they aren't trying? Programming languages have grown enormously in complexity in recent years, and this fosters an attitude that programming as a skill for specialists only. I tell my students that if all they can do is use other peoples' software, it will be a serious limitation on them as scientists, but they still never seem to learn to gain any programming proficiency. I've been thinking of starting a course on computational physics, so my students might see why programming is useful. I am also contemplating switching from C/C++ to Java, as a first programming language. C/C++ might be useful for exploring the fundamentals of computer science, but I just want to use the computer to do calculations. If I could have my way, I'd use Fortran, but too many of my students already have outright refused to learn it!

    P.S. That's FrankenSTIEN!

    ReplyDelete
  7. It is a bad idea to do physics in C or C++ because the language standard does not guarantee the order of operations and the optimizer can undo all of your careful work to mitigate the effect of roundoff errors. FORTRAN is really the only language currently suitable for physics and it has become as structured as PASCAL and as flexible as C.

    ReplyDelete
  8. Thanks for your advice on not using C/C++ for physical calculations, it is genuinely useful to me. Might we also rethink using C/C++ as a first computer language, even for computer science majors? Why not start them off on something easier, such as Java? Even for physics majors, Fortran has three problems: (1) Fortran compilers for Windows or Macs tend to be expensive, often outside of student price ranges; (2) Anytime I mention Fortran, people snicker about how old I am; (3) Largely because of (2), and really no other, rational reason, students just plain refuse to learn Fortran, to my face. I've also had students refuse to my face to learn Unix, even though it's the standard operating system in my research specialty, astronomy. This is yet another situation that makes me lament, what do these people want from me? Do they expect me to wave a magic wand and turn them into programmers? I hate to admit it, but I'm starting to think that's what they do expect.

    P.S. That's FrankenSTIEN!

    ReplyDelete
  9. If they refuse to learn what you tell them to learn flunk them/tell them to find another adviser. You are the professor, you will decide what they need to learn.

    ReplyDelete
  10. Telling them to cheese off will work for research students, since I get more than enough of those already. It will not work for the computational physics class, since so few students would take it if it were offered in Fortran, the Dean would cancel it. Java it will have to be, then, unless there is some compelling reason why not that I still don't know. I will flunk any student in this course who doesn't achieve at least minimum proficiency in Java programming by the end of the term, but of course my Spineless Department Chair will reverse any such decisions, much as how our Incompetent Dean of Students has let off every last cheater I've ever reported. But I haven't given up yet.

    ReplyDelete
  11. Java will be easier for them to learn than C++ - no pointers or memory management, for one thing. On the other hand, they will have to understand the basics of object-oriented programming and that may be harder to grasp than procedural programming. The two languages are similar enough that if they have a desire to learn C++, it shouldn't be hard to transition if they've learned Java. If your students aren't CS majors, they might do a little better starting with Java instead of C/C++. Good luck to you!

    ReplyDelete

Note: Only a member of this blog may post a comment.