2A. The Swamp


The swamp

One of the goals of this course is to teach you some fundamental techniques for developing large-scale software. But it is not feasible to ask you to write large-scale software, so you will use large-scale techniques on small-scale software.

Even small-scale software can be formidible to write if not approached in a sensible way. Without discipline, you will be tempted to take what appear to be shortcuts, but that actually take you into a vast swamp where your feet get stuck in the mud. Instead of making progress on your project, you will spend all of your time trying to get out of the swamp.

The smart thing to do is to resist the temptation to go into the swamp, and instead to adhere to sensible software development principles.


Ways students find themselves in the swamp

A student came to my office for help in writing a function definition of about 10 noncomment lines. He showed me his attempt, which made no sense at all.

We carefully planned it out, then wrote the code, in 20 minutes. Afterwards, the student remarked how similar our result was to the code that he had started with. But there were some small differences.

He said that he had started with his initial attempt, which he found did not work, and then had spent 8 hours making random changes to it. When I asked him why he had worked that way rather than planning first and debugging in a sensible way, he said that he did not think he had time for that!

Here are some ideas that look like shortcuts but that actually take you into the swamp, and are anything but shortcuts.

Those are some ways of getting into the swamp. What you want, of course, is to know how to stay out of the swamp. That is too large a topic to cover on this page, but it will be the subject of other pages in these notes.


Summary

In this course, we will discuss methods for developing software that have been proved useful. It is up to you do decide to use them.


Exercises

  1. Why is debugging by guessing not a good idea? Answer

  2. Why shouldn't you suppress warnings? Answer

  3. What is a danger in using an integrated development environment? Answer

  4. The software that students write in this course is not large, Why should students use techniques that are suitable for large-scale software? Answer