Wednesday, September 8, 2010

Programming as Problem Solving

The programming process
I highly recommend the book Computers Ltd.: What They Really Can't Do as a good introduction to the concepts of computability and complexity from a non-technical perspective.  The figure at right is inspired by a diagram the book uses to introduce the concepts of programming and programming languages.

When a programmer has an idea for developing a new piece of software, the first thing he does is express this idea as a algorithm.  An algorithm is a method for solving a problem in a step-by-step fashion.  The next step is to implement this algorithm in a high-level programming language; this is a language designed to make it easy for a human to tell the computer what he wants it to do.  The programmer then uses a special program called a compiler to translate this language into machine code, which is a series of instructions the computer can understand.  The result is a software program that can be run on a machine, such as a laptop or a smart phone.

From this description, you can see programming is a two-step process, of first designing an algorithm and then writing it in a programming language.  Algorithm design is usually the hardest part; computer scientists often refer to the need to train students to think algorithmically.  A good definition of what we mean by this is found in Developing Algorithmic Thinking with Alice, a paper by Cooper et al. that was published in the 2000 Information Systems Education Conference:
1) state a problem clearly, 2) break the problem down into a number of well-defined smaller problems, and 3) devise a step-by-step solution to solve each of the sub-tasks
This is an extremely important skill that transfers over into many disciplines, and the reason why we believe most students can benefit from taking at least one programming class sometime in their education.

2 comments:

Jonas said...

I've found that though algorithms were emphasized when I was in school, they are something I hardly ever think about now. System design, code maintainability, and clear understanding of requirements are much more important. Maybe it's because I've internalized all that algorithmic thinking, so I don't even notice it anymore..:-)

Daniel Zappala said...

As I teach about programming to a general audience, I inevitably simplify too much. By algorithmic thinking, I mean in general the ability to break a larger problem down into smaller parts -- not just the traditional topics taught in an algorithms course (graph algorithms, dynamic programming, and so forth). But I agree, these other aspects of programming can often be as important as algorithmic thinking, and we hit our majors hard with this in our software engineering classes.

Post a Comment