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

August, 2011

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Languages That Make You Think

    • 6 Comments

    The old joke used to be that “a good FORTRAN programmer can write a good FORTRAN program in any programming language.” The problem and what makes the joke not all that funny is that it involves not taking full advantage of the language in question. It is not a FORTRAN specific problem by any means. I have known many so called C++ programmers who really wrote C programs using a C++ compiler. Many programming languages are designed with an idea towards changing the way programs are written, problems are solved and how people think about problem solving.  Taking on a new programming language without  changing ones thinking is often a missed opportunity, at best, and a cause of serious problems at worst. I recently came across two posts inspired by one of  Alan Perlis's epigrams: "A language that doesn't affect the way you think about programming is not worth knowing." This comes after the same issue from a slightly different point of view.

    To some extent programming languages are idiomatic. That is to saw that there are particular ways that the language should be used. While it may be possible to use it the same or similar ways to other languages, the FORTRAN program in any language way, that is not the best most efficient way to use it. To get the most out of a language you have to think a little differently. A lot of languages are pretty similar – Java and C# for example. But there are still differences. Most obviously those differences involve libraries but there are subtle differences in the languages themselves. For example Java and put and set methods which are a little different from properties which are a different form of get and set.. The thinking involved is a little bit different.

    Other languages are very different. Scheme and F# are two examples of functional languages which are a completely different paradigm from languages like Java and C#. You’d really run into trouble trying to write FORTRAN programs using one of them.

    Visual languages like Scratch, Alice and Kodu are different (from each other and from other more traditional languages) in still more ways. I think we often focus on simple concepts, like loops, that feel the same but miss out on different ways of thinking about things like subroutines and methods. Kodu for example uses pages in much the way that subroutines are used in other languages. They have a a different sort of feel to me though. There isn’t a traditional return statement for example. This changes things. It means that leaving a subroutine doesn’t automatically go back to where it was called from. I’m still thinking about how best to take advantage of that. I am finding that Kodu is changing the way I think about programming. This is a surprise to me but in a good way.

    At the high school level there is a tendency to stick with one programming paradigm and even often a single programming language. I wonder it that is too narrow a way to teach programming. Younger students seem to adapt to different languages and paradigms faster then older students – much faster than their teachers all too often.  There isn’t a lot of room in the curriculum at most high schools to cover multiple paradigms in a single course. Over a couple of courses a school might cover a couple of languages perhaps. I recommend at least two and would prefer three. Mostly people tend to concentrate on the similarities between languages rather than the differences. There are advantages to this. The disadvantages are less clear though but I am starting to think that there is some value in talking about the differences. A good education widens ones horizons rather than focusing too narrowly. Something to think about. You know, while we are talking about making people think. Smile

    The blog posts that inspired this post are both well worth a good read.



  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Abstraction At The Core of Computer Science

    • 6 Comments

    I spent the latter part of last week in Palo Alto, California working on the CS 2013 project. There are some pretty amazing people involved in this project (CS 2013 steering committee) and I learned a lot in the various discussions we had around computer science curriculum. Since we are talking about what absolutely positively much be part of undergraduate computer science curriculum it is not surprising that core concepts are an important part of the discussions. One statement that was made was that “abstraction is at the core of computer science.” This is quite true of course but it struck me that maybe we don’t talk enough about this early enough in high school computer science courses. It is an important vocabulary word but do we really talk about what it means at a deep level? Sometimes perhaps but always? Not so sure. I’m pretty sure I never spent enough time on it.

    What do we mean by abstraction? There are some interesting definitions floating around that can be used for starters.

    Making all of this clear to students can be tricky especially when we introduce abstract classes. So what is the simple version? I see abstraction as using symbols to represent real things. In other words, we model the real world using data (numbers mostly but also images and words) so that we can manipulate them  using the computer. We can’t generate real wind or real buildings in a computer to see how buildings react to different speeds of wind but we can model the effects. Push buttons on the screen don’t actually depress but we can model that behavior by using the right abstractions. Abstraction is a tool for acting on imaginary objects that represent real things.

    In a sense object oriented programming and graphical user interface programming both simplifies and complicates our discussion of abstraction. On one hand the GUI objects make it easy to model real work objects of specific types. At the same time, for some students, it makes it harder to understand models or abstractions of items that are not visible on the screen. Personally I find that properties, as implemented nicely in C# and Visual Basic, do help to picture the abstraction – the way the software object represents the physical object it models – of various real world objects. Your mileage as they say may vary of course. The fact that objects have properties and methods is what enables us to model real world objects. At the same time making the transition from physical objects to numbers that somehow represent those objects does not come naturally for everyone. It is important however that they do make the transition. This is at the heart of how computer science works.

    I’m trying to work out in my mind how to involved abstraction both earlier and more consistently into a first programming course. My gut tells me that in the long run that would make understanding more of the concepts easier. Do any of you out there have particularly good discussion points, resources or lessons learned about teaching abstraction to share? Any textbook that does an especially good job of it? Or perhaps an operational definition that you find works for you and students?

    Abstraction is a core concept in computer science. On the other hand it is a bit abstract for some students. (Sort of pun intended.)



  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Web-Based Problem Solving Software for Programming Courses

    • 0 Comments

    We all know that students  benefit for problem solving exercises. Creating these sorts of problems can be difficult and time consuming. Evaluating them and help students with then can be even worse. There are a couple of online sites that can help here. I’m going to highlight several of them here – Pex4Fun (from Microsoft), Problets (from Amruth N. Kumar at Ramapo College of New Jersey) and Try F# (from Microsoft). I think these can be very useful in support of students learning programming either as part of a course or on their own. Pex 4 Fun supports Visual Basic, C# and F# programming. Problets are available for several C-family languages including C# and Java. Try F# is, surprise, all about F#. They are all worth checking out though. And they can be fun as well as educational.

    Pex 4 Fun

    PexWeb2What is it? Pex for fun brings programming in C#, Visual Basic, and F# to your web browser. If you have never visited Pex for fun before, we suggest you follow the tutorials in the Learn area.

    Is it just for fun? The full version of Pex and Code Contracts integrates into Visual Studio, and can be launched from the command line as well. (Download, Documentation) Pex can explore an entire project at once and can automatically generate a comprehensive test suite of traditional unit tests.

    Who created Pex for fun? Pex for fun was brought to you by the Pex Team, part of the Research in Software Engineering (RiSE) group at Microsoft Research.

    I have more questions. You can discuss Pex for fun on our MSDN Forums for Pex, where you can also post your Permalinks to share them with other people.

    I want to provide feedback. If you have found a bug, you can send a bug report directly to the Pex developers at pexbug@microsoft.com. You can also get in touch with the Pex developers for any other reason at pexdata@microsoft.com.

    Can I take any code in the browser and turn it into a puzzle? If your browser supports it, you can Install the Pex For Fun Accelerator.

    Problets

    (This is taken in edited from from a recent email to the SIGCSE mailing list)

    Problets are web-based software tutors for programming topics. They provide problem-solving practice on expression evaluation (arithmetic, relational, logical, assignment), if, if-else, switch, while, for, and break/continue statements, arrays and functions (behavior of functions, debugging functions) in C/C++/Java/C#. They are free for educational use.

    The unique features of problets that make them effective are:

    • They explain the step-by-step evaluation/execution of the correct solution;
    • They adapt to the learning needs of the student.

    You can find out more about problets at:http://www.problets.org This site contains information about solving problems with problets, how problets can be used in a course, sample problets, and student testimonials.

    Try F# Tutorials

    F# is a functional language so it is a different programming paradigm from what most of us learned or have taught before. It is however a very valuable paradigm to know and use. For teachers who want to offer their students a comfortable way to learn F# this is the site to use. The tutorials on this web site are designed to give you an easy way to teach programming using F#. The benefit of using online tutorials is that students don't need to install any complex software package and can easily access tutorials from any machine. The Teaching F# page contains some additional useful links to existing course materials on F# as well as articles and presentations that may serve as additional inspiration for the classroom.



Page 1 of 8 (24 items) 12345»