Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

December, 2010

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Four Key Concepts of Computer Programming

    • 18 Comments

    Last week Rob Miles who is taller than I am, has more hair than I do and has an English accent all of which indicate he is probably a lot smarter than I am left a comment on one of my posts that lists his idea of the four key concepts in programming. He left to comment on Do We Need A New Teaching Programming Language BTW. The post and his full comment are worth the read. Rob’s list was:

    • Process data (assignment)
    • Make decisions (if)
    • Loop (do - while, for)
    • Use indexed storage (arrays)

    Among other things he said:

    If you can do these four things you can write every program that has ever existed. Sure, the code won't be pretty, but it will solve the problem. In my course we focus on algorithms at the start because this is where we actually create behaviours  [note classy British spelling which adds credibility] that solve problems.

    In all seriousness, Rob is a great teacher who also writes some really good textbooks. He really knows his stuff. All of that not withstanding I kept trying to think of a fifth thing to add to his list.

    I thought about input/output for a long time. But I/O is such a platform dependent sort of thing. It depends not only on the language but the operating system and even available hardware. Input via a key board is different from punch cards (remember those) and still more different from input via a Kinect sensor (let’s keep in mind that there is a future). As I recall the PASCAL standard did not specify requirements for input/output and left it to the developers for individual platforms. So that probably doesn’t fit.

    I thought about variables but that is sort of covered by process data and indexed storage. Even internal data representation which I see as a key computer science concept is probably not as key for programming. I have successfully used programming languages that only stored integers and strings. Well maybe there was a Boolean but I forget. I managed to write some useful applications anyway. Some even dealing with money.

    Recursion? How often do you really need recursion? And a lot of things that recursion is used for loops will do just fine for. So while one should learn recursion and a really good programmer should know how, and more importantly when, to use it I don’t think it fits the top four or five list.

    Would you add something? Remove something? Overall what do you think of Rob’s list?

    Note:  To subscribe to this blog please use http://feeds.feedburner.com/ComputerScienceTeacher as the RSS feed source. Thanks.


  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    How not to teach programming

    • 14 Comments

    Through the wonders of DZone I came across a blog post called Don't teach like you code. The target audience seems to be professional coders who are teaching beginners. It’s always interesting to read articles like this and part of that is to understand the perceptions that people have about teaching when they are not full-time teachers themselves. And this article does make some good points about how not to teach. Unfortunately the examples of how people, one presumes the author included, actually code are not what I want new programmers to learn. In fact this post was quite unsettling to me as someone who made his living writing code for 14-15 years and who still writes some when necessary.

    The article has a line that reads “”But, good coding isn't like teaching at all. It promotes habits that are entirely counterproductive to the art of teaching.” Really? I’m skeptical. He goes on to say “”Part way through writing a method, you might decide you need to track things in an array. After a few minutes, you'll decide a hashtable works better.” Oh please in the name of all that is good in the world don’t let that be common among professional developers. Yes, that happens sometimes but it should be awfully rare. You should have thought things through in some detail before you started coding. If you are making big data structures in the middle of coding you clearly (in my opinion at least) were not ready to start coding at all.

    On the other hand in teaching I would expect this to be more common. Specifically the lecture that worked well with one audience may not work as well with another. A good teacher sees this, adapts and tries to explain things a little differently.

    And then there is this gem “Second, coding lets you cheat on the details. We compile our code not because we think we're done, but because we want to find out what we may have missed. ” No! If you run the compiler and get errors and warnings you should be surprised. Or at very least disappointed. Now maybe the author is using crummy tools. I am spoiled by Visual Studio which notices a lot of syntax and other errors as you are typing. And IntelliSense goes a long long way toward helping avoid spelling errors. This makes it easier to avoid missing things. But don’t people read though and self-edit before compiling any more? Some days I think we were all better off when programmers had only one or two chances to compile their code a day. Coding is about details. Cheating on details is a path to destruction.

    The last line of the article is priceless. “How do you teach people well? It starts by knowing that what may make you a great programmer will not make you a great teacher.”  Probably true. But you also have to understand what makes a great programmer. I think a lot of programmers have a much higher opinion of their coding ability than is warranted. I never saw myself as a great programmer BTW. In fact I know what a great programmer is and how they work. I’m pretty sure I don’t have it. But I know enough about it to teach it. Like a great football coach who has never thrown a touchdown pass or gotten a sack or kicked a field goal but who can help others do all those things better a good teacher is someone who helps others learn from the mistakes of others.

    A great programmer may not make a good teacher because they may not understand how they do what they do in a way that they can translate for a beginner. But someone who speaks the language of software and can translate the concepts and ideas for beginners may make for a great teacher even if only an average (or even fair) programmer themselves. We still have to focus on what makes for a great programmer not what makes a lazy programmer though.



  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Do We Need A New Teaching Programming Language

    • 11 Comments

    I saw some discussions lately about the need or lack of need for new programming languages. In once case especially for teaching programming. In general I think that new programming languages are a good idea. From time to time it is good to start fresh and incorporate the latest ideas in a language that was designed from the ground up. C# is one example. Java is as well. Although personally I think C# is better having been able to learn from the mistakes made in Java. F# is still another example. But none of these were designed for teaching programming. The last big success in that area was PASCAL.

    PASCAL was widely adopted for education and in fact was the first programming language of the APCS exams. It fell out of favor largely because object oriented programming became the standard programming paradigm in education. Before PASCAL we had BASIC which was designed as a language for beginners to use to learn programming. BASIC had its critics but there were sure a lot of people whose first learning about programming came from the BASIC that came with  their personal computer.

    Today first programming languages are all over the map. There is Kodu for the very young. Alice and Scratch for middle school (and up) and at the high school level we see Java (largely because of the AP exam), Visual Basic (and other versions of BASIC such as Small Basic), C++ (yes still and seeing a resurgence of sorts), C# (especially with the ability to create games with XNA) and Objective C (for some robotics and iPhone applications). Python seems to be picking up steam of late. And yes, in some areas, Scheme, which is a functional language, is being used. DrScheme is in fact designed for teaching as are Alice, Small Basic, and Scratch. So it is not as if languages designed for teaching don’t exist. But are they the right ones? That’s a question to start a debate.

    Speaking of debates, just about any time someone asks about what the first language for teaching should be someone will suggest Assembly language. Now that works for some people. Bill Gates started with Assembly language for example. Worked for him. I’m not so sure it works for everyone or even for more than a few people. Eventually people are better off if they learn it but it is not a great first language.

    SO what should a teaching language be like? I would suggest that a simple syntax with limited keywords would be a good start. Should it be an object oriented language that lets users create objects? I’m not so sure we need that right away. Use objects – Yes! Create objects? I’m on the fence. The objects first crowd would howl about that but I am not convinced that we need objects first. See mark Guzdial’s There is no “First” in CS1 What I want in a first teaching language is simplicity and creating classes is all too often not simple enough.

    Strong typing or weak? Early or late binding? Does it really matter? Think simple. And always remember that you can’t teach all of programming let alone all of computer science in the first course.

    I really like the graphical programming in Alice and Scratch. My biggest issue with them both is that dealing with variables is not easy enough. It’s not hard but it is also not obvious enough. Also input is too limited for my way of thinking. On the other hand Small Basic has much of what I like but has more syntax to mess with people. Syntax aside Small Basic has one other thing going for it that I really like – the graduate button. Small Basic has a simple and smooth transition path to Visual Basic which is a full featured Object Oriented language with professional strength IDE and everything. Alice looks like it will have a path to Java but it is still “coming” and when you get there it is still Java. I’d be happier it if took one to VB or C#. Either way a good teaching language should have a smooth path up the latter to professional tools.

    Do we need a new language? Some are saying that Python is it. I’m not so sure.It may already be too complicated. Small Basic, in my opinion, is great in that it allows us to start younger and has a path upwards. Something with the drag and drop style of Scratch and the Windows Forms features of Visual Basic and C# would be really cool. Especially if there were a “graduate button” to a next level language. What do you think?



Page 1 of 7 (19 items) 12345»