Hacker News new | ask | show | jobs
by fohlin 5743 days ago
I've just left a workshop at our CS department, where we discussed new and old issues with teaching programming. Tutorials and assignment, based on completely made up cases and requirements, are still very much at the core of introductory programming courses. This is in sharp contrast to what DHH says in the post, as well as comments here and elsewhere.

May I be slightly selfish, and ask a question to all of you who have a CS degree? Did you learn programming as part of your CS education? Regardless, what's you opinion about the way programming was taught?

5 comments

I was a self-taught programmer (with a little parental help) long before I took a programming course in school; I started when I was about 9 years old.

I breezed through the college freshman-level programming courses (and pretty much all of the later CS courses too) because I already knew most of what was being taught. My friends (most of whom had minimal previous programming experience) were much worse off; I don't think I would have done even as well as they did if I were starting from scratch as I entered college. I had a 9-year head start on them, although I learned at my own pace and on a self-directed, meandering path without any structured classes or tutorials.

Most of those friends graduated with a CS degree while still not fully grasping concepts like how malloc() works (this particular example comes from one of my friends who invariably showed up at my door looking for debugging help near the deadline of every C project, complaining that malloc was breaking his program). I feel like I probably missed out on some useful tidbits because I mostly tuned out the CS classes, since I felt like I "knew it all" already (obviously not true, but close enough that I could do well on the finals), but I am certain I knew more about practical programming than most of my friends who studiously applied themselves in those same CS courses.

If I hadn't had previous experience programming, I doubt I could have become an effective programmer in just four years of academic instruction (I certainly didn't fare so well in my non-CS courses in which I had no previous experience). Observing my friends, I could tell they were having a rough time with the way programming was taught, but I don't know whether that is a solvable problem within the time constraints.

I doubt my approach to learning programming was the most effective possible, but I think it's worked reasonably well. I learned to program because it was fun, not because I wanted to make anything useful, and I enrolled in CS because it looked like a way to continue that fun. In the end, I was disappointed by the (lack of) depth in the CS courses I took and the amount they rehashed things I already knew, but I suppose it's not feasible to tailor undergraduate courses to people who are already programmers. Perhaps with the growing accessibility and popularity of programming, there is a place for "CS for programmers" that would skip the introductory content and get into the real meat earlier than the third or fourth year. Certainly the courses I took met neither the needs of myself (too basic) nor my non-programmer friends (too advanced too quickly).

May I be slightly selfish, and ask a question to all of you who have a CS degree? Did you learn programming as part of your CS education? Regardless, what's you opinion about the way programming was taught?

By the time I started taking classes, I'd already been programming for fun for a while. I continued self-teaching; it was both necessary and entertaining. In class, I was taught the basics of Java, LOGO, MIPS assembly, C++, Scheme, and Prolog, and course material also used BASIC (which my father had taught me), C, and x86 assembly (which I taught myself). The earliest classes spent a lot of time teaching the language, whereas later classes assumed that students either had prior knowledge of it or would learn it on their own (except for Scheme and Prolog since these were expected to be students' first exposure to functional and logical programming). I think the expectation of some self-teaching is really necessary to ensure that students learn to do so before they graduate. Putting together simple building blocks given on lecture slides only takes one so far; eventually, you'll have to do something you didn't learn to do in class.

    May I be slightly selfish, and ask a question to all of
    you who have a CS degree? Did you learn programming as 
    part of your CS education? Regardless, what's you opinion 
    about the way programming was taught?
I learned about programming (aside from some casual observations) as a freshman EE student. After my first year I decided that the heavy math and physics requirements of EE would kick my ass, and that I much preferred the opinionated reality offered by writing software. So I changed my major to CS.

Programming per se was poorly taught. There was little emphasis on long-term code management, and only moderate emphasis on writing clean modular code. So I learned better coding practices from more skilled developers while school taught me language syntax and concepts.

All through college I was fascinated by cellular automata and artificial life, so every time I had a new language class I went off to write CA code, trying to make them run faster, cleaner, and provide nicer options. Pscal, Fortran, C; never got around to doing CA in COBOL though; dropped out of that class. :)

I studied CS at the University of Toronto in the early 90's and in hindsight I'm amazed that we never formally taught how to program. (The one exception I can recall is a "theory of languages" course that gave us a brief exposure to half a dozen languages, but it was an optional course and wasn't part of the core curriculum.) We were basically given assignments by the profs and it was assumed that we would pick up programming in the tutorials with a little help from the TAs!

Personally I had the benefit of having done a fair bit of programming in high school and on my own (Amiga AMOS FTW!) so I survived but I know it was very difficult for students who hadn't had any programming experience prior to university, and the drop-out rate from the CS program was very high (> 50% IIRC).

That's very interesting! With that hindsight, can you identify any quick wins that could have lowered the drop-out rate, or helped your personal understanding of programming?
I think the key is to lower the barriers to creating minimal, working, useful, hopefully interesting programs as much as possible.

E.g., start with a minimal implementation of the Unix 'wc' command in Python, walk through it explaining how it works, and then assign as homework adding the '-l' line counting option. As a professional it's trivial, but if you know nothing about a programming it can be very difficult to get started doing anything. It's too easy for us professionals to forget how much we know now.

Focus more on the performance characteristics and design trade-offs of core algorithms and data structures (e.g., binary search, quicksort, dictionaries, vectors, lists) and less on the nitty gritty of implementing them.

Starting with interactive languages like Python that handle garbage collection and have high-level containers built in is also useful. Noisy stack traces when something goes wrong are also much more accessible than a C or C++ core dump.

Another thing that irked me was the expectation that we were already emacs or vi experts! For beginning programmers, Notepad or Gedit is perfectly adequate.

The best CS classes I had drove a single project through a semester, with the lessons applying to the next development tasks you needed to undertake. By the end of the course, you had a reference project that you could carry forward, and even continue to work on if you wanted to.