[Edu-sig] Progamming advice. (Was: Why MIT switched from Scheme to Python)

macquigg at ece.arizona.edu macquigg at ece.arizona.edu
Tue Apr 7 15:14:54 CEST 2009


Gary Pajer wrote:

> But to clarify:  I've been programming in python for about six years, along
> the way abandoning Matlab in which I was a local go-to guy.   By the  way,
> I've also adopted Traits and the Enthought Tool Suite, which IMHO might
> possibly be the future of practical laboratory programming in python.  So
> I'm comfortable enough with the nuts and bolts of OOP.   But higher level
> questions like what to make a function, what to make a class, what to
make a
> module, how best to factor it all out, when to decimate a long routine into
> a bunch of shorter ones, how best to organize input, computation and output
> (Traits' MVC architecture helps there), how to think about designing for
> reuse, how to reuse what's already available, when does sub-classing make
> sense, when do exceptions make sense...  and so on and so on.

<snip>

> I'm wondering if some wizard has written a guide to program structure
> paradigms for the intermediate programmer.  Or perhaps this kind of
thing is
> actually taught in books somewhere...

A good book on exactly this subject is "Object-Oriented Modeling and
Design with UML" by Blaha and Rumbaugh.  Here you will learn about Class
Models, State Models, and Interaction Models.  It may be a little tough
for self-study, however.  I studied it in a class on OOP, taught by a
professor who was not only an inspiring teacher, but had plenty of
experience in large projects.  It might have been a dull read otherwise. 
He also had us work in teams of 3 to 4 students each, thereby forcing us
to pay attention to modular design and interface definitions.

Another good book, maybe better for self-study is Steve McConnel's "Code
Complete".  This is more like an encyclopedia of good programming, so you
can read a topic without reading the whole book.  If you want a quick
summary of the "goto" debate, look here first.

I think what you really need, however, can only be acquired through
real-world experience designing systems that are complex enough to
*require* good modular design, well-defined interfaces, etc.  I think of
OOP as just one tool in a bag of good engineering practices.  TDD is
certainly another.  Using good data structures is another, and Python is
really superb at getting you to formulate your problem in terms of simple
data structures.

-- Dave






More information about the Edu-sig mailing list