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

January, 2007

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Picking Programming Languages for High School - Never Ending Story


    I see that Susan Canaga is bringing her school's discussion on programming languages looking for industry opinions. This is a topic I have addressed a number of times before (most recently here) but one which never seems to be settled. In any case if you an opinionated individual and want to put in your two cents I'm sure Susan would welcome the feedback.

    As I have said more than a few times I like Visual Basic. NET as a first language. The syntax is easier than the C based languages. Literally millions of programmers use Visual Basic to develop applications with significant user interface needs. So it does scale up to full scale professional development.

    C# would be my second choice for a first language and my first choice for a second one. I like that it is a .NET language which means that you can learn and use the .NET Framework classes. And of course C# allows students and others to easily use the XNA Game Studio Express to create video games for both Windows and the Xbox 360. I happen to think that C# is an easier language to learn than Java. Yes I am biased but I came to that conclusion years before I came to work for Microsoft. I like the way built-in types are handled in C#. I also like using properties (an option in VB as well of course) and other features. LINQ and related features that are coming (also for VB) in the near future look like they have the potentially to really simplify handling data bases and other large amounts of data easily. That has huge potential.

    C++ is a language that is not going to go away any time soon. It is still the language of choice for a lot of high performance gaming, embedded systems, and anything that absolutely has to get close to the hardware. A first language? Not if up to me. On the other hand the things one can teach using C++ makes it an important language for someone who intends to be a serious student of computer science. If it were up to me I would probably have left C++ as the language of the Advanced Placement exam. C++ is not the best way to learn object oriented programming. C#, VB and even Java are better for that. On the other hand there is power, at the cost of ease and safety of course, in C++. I like that for when it is really needed.

    But of course if it were up to me no one would take AP CS as their first programming course. That's like taking AP Calculus without having Algebra and Geometry first. It can be done but it is hardly a good idea.

    The Visual Studio Express editions are available for free in C++, C#, Visual Basic and Visual Web Developer editions so teachers and students have some great free options for all of those languages. If someone wants to make the case that Java is better than either C# or VB as a first language go ahead. (I've got my flack jacket on.) I feel sorry for AP teachers who have no choice but to teach it.


    Technorati tags: , , ,
  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Programming Proverbs


    A recent blog post by Josh Ledgard reminded me of a book that had a great influence in my early programming days. The books was Programming Proverbs by Henry Ledgard and I still have my copy. It's one of the few computer books I bought in the mid 1970's that still has some relevance.  The code examples are in ALGOL, FORTRAN and BASIC but the ideas apply to most all programming languages. Dr. Ledgard also wrote related books specifically for C, COBOL (I have that one), FORTRAN (I used to have that one but I can't find it) and PASCAL. It was quite the series.

    I've been re-reading the book since last week and I am thinking about writing a series of posts about each proverb. I'm interested in seeing some discussion about how each one holds up over time. The book is over 30 years old and there is a lot we have learned about programming in that time. Or is there? Other than Object Oriented Programming what's new? Are programs today less buggy than they were thirty years ago? Actually I think they are worse many times. Perhaps we should bring more of these proverbs to people's attention? Of course many of them are being brought up but are people really paying attention? Let's discuss it.

    What is the list you ask? Well here it is.

    1. Define the problem completely
    2. Think first, Program later
    3. Use the top-down approach
    4. Beware other approaches
    5. Construct the program in logical units
    6. Use procedures {methods}
    7. Avoid unnecessary GOTO's
    8. Avoid side effects
    9. Get the syntax correct now, not later
    10. Use good mnemonic names
    11. Use intermediate variables properly
    12. Leave loop variables alone
    13. Do not recompute constants within a loop
    14. Avoid implementation-dependent features
    15. Avoid tricks
    16. Build in debugging techniques
    17. Never assume the computer assumes anything
    18. Use comments
    19. Prettyprint - format your code so that it looks nice
    20. Provide good documentation
    21. Hand-check the program before running it
    22. Get the program correct before trying to provide good output
    23. When the program is correct, produce good output
    24. Re-read the manual
    25. Consider another language
    26. Don't be afraid to start over

    What do you think of this list? Anything you would add or drop?

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    What are you teaching (in your first programming course)?


    I ran across Robert Floyd's Turing Award lecture last night. It was an interesting read and frankly there was a lot in there to make me think about the state of computer science, computer programming and how we teach those two closely related topics. One question he mentions is asking another computer science teacher "what he teaches in his introductory programming class." The answers he often got were "Fortran" or "PASCAL". The talk he gave was in 1978 and those were the languages used. Today we often get the answer "Visual Basic" or "Java" or even "Python."

    But as Dr. Floyd suggests those are really the wrong answers. Those languages are just syntax and grammar and not what we really need to be teaching. We need to be teaching design concepts, paradigms of programming, ways of looking at and solving program, and in short concepts that are (usually) language independent.

    The Fortran I learned in the first programming course I took is all but dead. COBOL is pretty dead outside of specific and legacy applications as well. (Not that either language seems to ever want to die completely and yes I know that people still write new applications in them.) But the concepts I learned live on and have served me well long beyond those courses.

    When Dr. Floyd gave his talk structured programming was the new paradigm and now it is an old one. Top-down design was new then and now is old. But they are both still valid even today. Object Oriented Programming is the new thing and it is great. But it doesn't replace the old completely.

    So what then do we teach in the first programming course? Is the language important? Of course it is. Discussion of which language to use causes great debates. My own recent post on the subject has a large number of comments. But that is not the essential question and I have come to think that it (the language) should not be the name of the course and it really should not be the foundation of what the course teaches. When the language becomes the subject the value of the course in preparing students for a live-long career is diminished.

    So what do you teach (or recommend teaching) in your first programming course?


Page 1 of 9 (26 items) 12345»