Slashdot Mirror


User: Lupin+Variant

Lupin+Variant's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. Re:A Famous One Is... on Conceptual Models of a Program? · · Score: 1
    In the process of designing our introduction to computer science (see our curriculum), I've put a fair bit of thought into the question of how to instill good conceptual models of programs and program execution into folks with no programming or design experience. A number of posters have remarked on the distinction between design and programming, and one problem is that you really need to learn both, hand in hand, right from the start -- learning design without programming can be way too vague and abstract, but learning programming without design just instills bad habits.

    In our first semester, we focus on (small-scale) algorithm design techniques and discuss two models of programs. The first is basically functional, using functions, immutable variables, and conditional statements -- in this case, we describe execution in terms of "substitution" of values (or expressions) for variables. We then move on to discuss mutable objects, reference parameters, and loops, and the model of execution as the update of the state of the set of variable values. We've been doing this in C++ recently, though of course you could use scheme or Lisp, and we may move to Java soon. For those who are saying "No, no! Describing the execution of C++ programs in terms of substitution is wrong ", I note that the interpretation of a C++ program occurs in two phases -- first the optimizer does local modifications that really are like substitutions, and then at run time the state update model is more accurate -- so knowing how the two go together is really the only accurate model.

    In our second semester, we get into data abstraction, and then later introduce inheritance and parametric types -- these also serve to add subtle flavors to the models of execution as we get closer and closer to the object-oriented "paradigm". We also discuss the issues of scaling up our simple "single-algorithm" design techniques to full software projects, though we don't have an explicit "software engineering" course.

    We find it very hard to find textbooks that support our approach, and generally focus on trying to find things that do a good job on part of what we're teaching without doing too much damage in other areas. Thanks to all who posted recommendations for books (I tried to borrow heavily from SICP in the original design of our course).