Whither High School Computer Science?

May 11, 2007 at 11:12 am 19 comments

Last year, when I finally decided that I wanted to pursue a career in computing and programming, I decided to take the AP Computer Science class my high school offers (skipping Computer Science I, which uses Visual Basic 6). Though I had heard bad things about Java in the past, I figured it couldn’t be all bad – after all, in order to get kids excited about CS, they wouldn’t teach in a crappy and flabby language, would they?

Well, they did.

Now, I could launch into a rant about how CS doesn’t necessarily have anything to do with programming languages, how all that’s really important is algorithms and big-O efficiency, how aspiring CS students need math more than anything else, and so on and so forth in the vein of Knuth and Dijkstra. But I don’t believe it in the slightest. Sure, CS doesn’t necessarily have anything to do with any particular programming language, as shown by the decades of computer scientists who made stunning achievements simply through logic, mathematics and perseverance; however, CS is only interesting as an academic field because there are things which computers can do and humans can’t (and vice versa). A CS student trained without a knowledge of programming languages is nothing more than a mathematics student.

But I also believe that languages shouldn’t interfere with learning through syntactic or design flaws. Java is a major sinner in these regards. We spent several weeks going over (in excruciating detail) the difference between an int and an Integer – what, exactly, does that have to do with CS? Sure, we learned something about OOP – except for all the interesting things, such as the history of OOP, the reasons behind encapsulation, the uses of multiple inheritance (and the problems and solutions therein), and how OOP has changed from its pure Smalltalk roots to its bastardized Java form. We learned that we need to predeclare variables in a statically-typed language, but not any of the reasons why static typing may or may not be a good thing (speed, type safety, robustness, etc.).

And there’s so much we didn’t learn. We spent maybe a week on sorting and searching; never mind that the truly remarkable thing about computer-based algorithms is that they can search, sort, and process data in ways that no dead, ink-based y=mx+b equation ever could. We didn’t look at Nextstep’s use of object-orientation to power an entire operating system, quite possibly the most concrete use of OOP ever. If we wanted to focus on practical uses of Java, why didn’t we learn how to use Eclipse, the best Java IDE out there? Why did we use Java 1.4 instead of Java 1.5 or 1.6, thereby abandoning templates, primitive autoboxing and helpful classes such as Scanner?

If we truly wanted to learn about writing good code and learning the fundamentals of computer programming, we should have used Smalltalk. Using Squeak or VisualWorks or Cincom, we could learned how a truly, 100% object-oriented programming language works, the history of the GUI, how to create an intuitive GUI without endless Swing components, how to program in a robust, intuitive and simple language free of warts, and, most importantly, how to use computers to do things and solve problems that only computers can do.

Instead, we learn Java.

Entry filed under: code.

Cocoa Snippet: Detonate your Cursor Sandwiches.


  • 1. Adam Chester  |  May 11, 2007 at 1:39 pm

    I think that you’ve missed the advantages of using Java. Firstly there is no memory management to deal with, which makes it ideal for beginners. Secondly the Java language is widespread, making it a useful language to know. Lastly the library support provided is second to none, every element of a Java program from the model classes to the views (think MVC here) can be programmed in a consistent language.
    What I think that you’re trying to say here is that it was taught in a bad way, several weeks going over int/Integer would sure kill me too.
    The process of programming involves working with the quirks of the specific language, for Java this may be accepting the int/Integer stuff. While functional languages such as LISP or ML mean forgoing explicit loop concepts and really understanding recursion.
    I do think that statically typed languages help beginners identify faults at compile time, and follow the execution flow in an accurate fashion. I *LOVE* Objective-C/Cocoa too, but I wouldn’t teach it as first language on any CS course. I’m, not sure about teaching straight C first either, it took me ages to get my head around pointers. Java would seem to be a happy medium, a statically typed language without memory management to deal with.

  • 2. Teltaris  |  May 12, 2007 at 2:21 am

    @ Adam Chester

    The author was correct in saying that something like Squeak would have been a better choice for leavning OO. You don’t have to fark around with memory management in Squeak either.

    Java’s OO isn’t “pure”, as evidenced by the difference between “int” and “Integer”. So it leads to pointless confusion for people with little or no prior experience in programming.

    Squeak is a pretty interesting (IMHO) environment where students can see the results of their code INSTANTLY. Learning is best done when there is instant gratification whenever you perform an action.

    I think Java is anything *but* a happy medium, and students would have been better served using something else.

  • 3. Eric  |  May 12, 2007 at 3:45 am

    Of course, if they were to forgo Java in favor of a less common language, the teacher would have to hear endless complaints of “when am I going to use this”.

  • 4. Peter Burns  |  May 12, 2007 at 4:46 am

    You ask a lot of “why” questions. Why use older versions of Java? Why weren’t new and interesting features of the language covered? I’ve found myself wondering similar things myself, as I’ve pursued a CS education.

    I’d guess that the problem is likely that the professor isn’t comfortable with these concepts themselves. Teaching is a full time job, with a surprising number of responsibilities outside of the classroom that have little to do with what is actually taught. Professors tend to teach what they knew when they graduated, and go with what has worked in the past.

    This is a problem that persists even into college. Not only that, but I’ve heard from more than one professor that many in the academic realm aren’t actually interested in learning outside of their area of expertise, or in keeping up with what is going on in industry.

    Of course, the great thing about CS is that so much is available for free online. It’s been my experience that those who are really willing and interested in learning more have no trouble doing so, as you yourself seem to be living evidence for.

  • 5. Peter Boothe  |  May 12, 2007 at 5:25 am

    The best rays of hope I have seen are the writings of Jeff Elkner, who uses Python as a first language, and then spends the second year translating Python concepts into their more-verbose and craggier Java counterparts.

    I taught CS101 with Python last summer and I was astounded at how well it worked at allowing students to attack the interesting bits with only minimal interference. In 4 weeks, the students went from nothing to some pretty fantastic final projects.

    So, while Squeak has purity going for it, Jeff Elkner has experimental evidence (and I can back it up with at least one more data point) that Python may be another way out. I think the larger point is important, however: the first language that someone encounters will inevitably color the way they think of computers and programming for a long time.

    The inescapable conclusion is therefore that if we want students to see computers as the powerful, fun, and flexible tools we (or at least I) see them as, then we must give students languages that are maximally flexible, maximally powerful, and minimally painful. And we must teach in a way to emphasize the power, fun, and flexibility.

    Scheme and Lisp are flexible but painful (kind of – there’s dozens of flamewars waiting to be born from that one sentence). I don’t have enough Squeak experience to rank it well. Python hits a nice sweet spot.

  • 6. Dan Farina  |  May 12, 2007 at 5:39 am

    I vote for using Lisp in early computer science. Probably the dialect Scheme. Although it is also used at the university level, it’s so simple that one can quickly get past syntax and warts (or which there are very few at the introductory level) and quickly into actual computer science quickly. It has even fewer idioms than Smalltalk.

    It’s probably not as rewarding for a high-school level student as making things happen on screen as they go, though.

    The PLT project in particular write a very nice, accessible, modern, cross platform implementation with an integrated editor. (Despite the coolness of the Diva extensions I still am leery to move from emacs)

    I think a better book instead of say SICP or HTDP may be the Little Schemer and its companion books. Theese books are engaging and written in an accessible yet deep Socratic style (question, response). The SICP may be good to pull the themes together, but unless one is at that point already a very active and conscientious studier the question-response sections will do more to probe one’s real understanding of the material being covered as one goes along.

  • 7. Ian  |  May 12, 2007 at 5:50 am

    My high school taught Scheme (using the textbook Simply Scheme) during the first half of the class, then Java in the second. Proper high school CS programs ARE out there, but they’re very rare.

  • 8. Carl  |  May 12, 2007 at 7:35 am

    My vote for first programming language is Python: it’s free; it’s multiplatform; it’s neat and clean; there’s no crap about int v. Integer; it’s object oriented; it has automagic memory management; it has a good system for exception handling; you can do functional-ish programming if you want; it is strongly typed (though also dynamically typed, unlike Java); it doesn’t waste the programmer’s time; but it’s still pretty easy to transition from Python to Java or whatever else later if you want (unlike Lisp, which is very different from C-style programming).

  • 9. Dan Farina  |  May 12, 2007 at 10:45 am


    I have heard of such programs now and then. My introductory computer science instructor was Brian Harvey for a couple of semesters…doesn’t that name look familiar from the cover of Simply Scheme? šŸ˜‰

    I find some of the scheme extensions in Simply Scheme questionable and am not sure if I would have wanted to use them even while learning, but I’m certainly no expert when it comes to teaching, and learning computer science for the first time all over again is not something I can easily do.

  • 10. Top Posts « WordPress.com  |  May 13, 2007 at 12:00 am

    […] Whither High School Computer Science? Last year, when I finally decided that I wanted to pursue a career in computing and programming, I decided to take the […] […]

  • 11. Erik  |  May 14, 2007 at 2:23 am

    If you think Eclipse is the best Java IDE then you haven’t used IntelliJ IDEA. Eclipse is great as a general-purpose tools platform, supporting languages/frameworks like PHP, Ruby, and Flex among others. But for Java, there is simply nothing out there as powerful as IntelliJ.

  • 12. eipi  |  May 14, 2007 at 5:39 pm

    Firstly there is no memory management to deal with, which makes it ideal for beginners.

    This is true of all introductory languages suggested here, including Python, Scheme, and Smalltalk.

    Secondly the Java language is widespread, making it a useful language to know.

    True, but there’s a reason that most fields don’t teach high school students or university freshmen to use the tools that professionals use. Professional tools have a lot of complexities, like the int vs Integer or static typing in general, that get in the way of understanding the basics of the field.

    Mathematics starts students with the very concrete field of calculus, instead of starting with the abstractions of compactness and metric spaces that you need to understand the field of analysis, to which calculus is an elementary introduction. Similarly, physics teaches students how to set up elementary mechanics equations with Newton’s Laws instead of going on to the Lagrangian mechanics approach that working physicists use.

    Lastly the library support provided is second to none, every element of a Java program from the model classes to the views (think MVC here) can be programmed in a consistent language.

    This isn’t true. There are languages with broader and easier to use libraries.

    I do think that statically typed languages help beginners identify faults at compile time, and follow the execution flow in an accurate fashion.

    Actually, CS education research shows that static typing makes programming harder for introductory students. There’s no evidence that it helps them understand the execution flow, though there are environments for dynamically typed languages like Dr. Scheme that are specifically designed to help students develop a mental model of how a program executes. See the Teach Scheme Project page or the archives of the ACM SIGCSE conferences for references.

  • 13. eipi  |  May 14, 2007 at 5:45 pm


    If you’re interested in book recommendations from a CS professor, here are a few that I highly recommend:

    Godel, Escher, Bach, a fun introduction to the theoretical fundamentals of computer science by Douglas Hofstatder

    Code Complete, 2nd ed, a great book for learning the issues of coding beyond knowing the language, by Steve McConnell.

    How to Solve It, the classic by G. Polya that teaches you all of the problem solving techniques that your math and programming teachers should’ve but didn’t teach you.

    Structure and Interpretation of Computer Programs by Abelson and Sussman, which is my favorite challenging introduction to programming (using Scheme). It’s available for free on the net.

  • 14. Mark Miller  |  May 15, 2007 at 6:28 am

    I’m glad to see the concern, but the main goal of AP courses, as I understand them, is to teach students enough to pass the CS AP exam for college. As I understand it the AP exam comes in two flavors: C++ and Java. Students can take either one. So if students take the course and they pass the AP exam in sufficient numbers, then I think the school is going to think it’s doing its job well.

    I’ve been reading about a disquieting trend in the CS programs at universities. Their CS programs are turning into “all Java, all the time.” This isn’t true of all universities, but it’s something that’s been coming up on the radar of people who care about the computer science discipline. I’d suggest if you or anyone else is planning on pursuing CS as a major that you check out each prospective university’s program to get your own sense of what you will be learning, and whether it satisfies you.

  • 15. eipi  |  May 16, 2007 at 1:46 am

    Iā€™m glad to see the concern, but the main goal of AP courses, as I understand them, is to teach students enough to pass the CS AP exam for college.

    Ironically, the whole Java requirement comes from ETS, who makes the AP tests, and that’s the main force pushing Java into both high school and university curricula. Universities didn’t initiate the change from Pascal to Java and most professors I’ve met at the SIGCSE conferences wish we could go back to a better language like Pascal or Scheme. There’s a huge literature on the problems with teaching Java as a first language, and a lot of tools and techniques (IDEs, limited language variants, special educational libraries) that attempt to overcome the complexity of Java.

  • 16. Mark Miller  |  May 16, 2007 at 9:28 am

    What I heard was that industry was pushing it, but that may just be speculation. The worry is that the CS curriculum itself is getting watered down because of it. I’ve discussed this with a software architect who blogs at TechRepublic. He’s occasionally complained about “shake-n-bake” programmers, who don’t know much CS, and mostly know how to “glue” libraries together–and he’s talking about Java programmers. Not all of them, of course, but he says he’s seen it a lot.

    Then there was tickletux who posted about using the FizzBuzz problem as an interview question, and how he’s seen CS graduates and experienced developers who can’t solve it, or take a long time to do so. All it is is counting from 1 to 100 and picking out which numbers in the series are evenly divisable by 3 and 5. It’s examples like this that cause me to become alarmed. I mean, I could’ve solved that problem when I was in high school. Now I’d ask the guy, “What? Are you kidding?”

    Re: tools making up for Java’s complexity

    Yep. The thing is you better hope the tools can handle every problem you throw at them. Otherwise you’re on your own.

    I don’t pine for the days of Pascal, but I think Scheme would be a good language. Mark Guzdial, a CS professor at Georgia Tech. has used Python in his courses, and has had good things to say about Squeak. He wrote a couple books on it several years ago. Something he’s commented on is there are always a certain number of college students who avoid courses that involve programming. He talked about a physics professor who wanted to introduce some programming into his course. About 10% of his students dropped the class immediately. Those who stayed had positive things to say about the course. They actually enjoyed it. I don’t know, but I think the programming language they used might’ve had something to do with that.

  • 17. Mr Mvula Sande  |  May 29, 2007 at 1:50 pm

    Having read the above overview of CS,i feel inspired though still left behind due to the fact that the whole arena is new to me.I am a second year student at the university of zambia taking CS for the very first time this year.I would love to know how best i can STUDY this program in order to obtain good if not the best results at my institution on complition in 2009.Looking forward to hearing from you.

  • 18. Alfred Thompson  |  October 22, 2007 at 11:00 pm

    I realize I am late to the conversation but I would still like to put in a few things. First off the AP CS exam is only available in Java. They have never offered a choice of languages. It was origionally in PASCAL, moved to C++ for a few years and has now been Java for a number of years.

    Input from industry is pretty much ignored by the CCollege Board who hires ETS to write the AP exam. Actually the ETS/College Board is more complicated than that but that doesn’t matter much for general discussion. They look pretty much only at what languages collges teach. And then largely just a subset of innfluential schools.

    I think that the exam has moved more away from real computer science and more specifically a language test as it moved from PASCAL and C++ to Java. I used to teach AP CS when it was in PASCAL and C++ FWIW.

    Lots of langauges are better first langauges. Python is gaining favor. Scratch from MIT and Alice from CMU are being used more and more. I personally like Visual Basic but more because I have been using some form on BASIC for over 30 years. BASIC was invented as a teaching language though it has come a long way since those early Dartmouth days.

  • 19. Albina-ro  |  June 6, 2008 at 6:31 pm

About Me

I'm Patrick Thomson. This was a blog about computer programming and computer science that I wrote in high school and college. I have since disavowed many of the views expressed on this site, but I'm keeping it around out of fondness.

If you like this, you might want to check out my Twitter or Tumblr, both of which are occasionally about code.

Blog Stats

  • 697,395 hits

%d bloggers like this: