O'Reilly logo

Python Programming in Context, 2nd Edition by David L. Ranum, Bradley N. Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

“91974˙CH01˙final” — 2012/12/14 13:55 — page6—#6
6 CHAPTER 1 Introduction
You will understand and apply abstraction.
You will learn to think and communicate more clearly.
1.4 Problem-Solving Strategies
Problem solving happens on three different levels:
Strategy: A high-level idea for finding a solution.
Tactics: Methods or patterns that work in many different settings.
Tools: Specific tricks and techniques that are used in specific situations.
Paul Zeitz [Zei99] provides us with a helpful analogy for illustrating the three different
levels of problem solving:
You are standing at the base of a mountain, hoping to climb to the summit.
Your first strategy may be to take several small trips to various easier peaks
nearby, so as to observe the target mountain from different angles. After this,
you may consider a somewhat more focused strategy, perhaps to try climbing
the mountain via a particular ridge. Now the tactical considerations begin:
how to actually achieve the chosen strategy. For example, suppose that our
strategy suggests climbing the south ridge of the peak, but there are snowfields
and rivers in our path. Different tactics are needed to negotiate each of these
obstacles. For the snowfield, our tactic may be to travel early in the morning
while the snow is hard. For the river, our tactic may be scouting the banks for
the safest crossing. Finally, move into the most tightly focused level, that of
tools: specific techniques to accomplish specialized tasks. For example, to cross
the snowfield we may set up a particular system of ropes for safety and walk
with ice axes. The river crossing may require the party to strip from the waist
down and hold hands for balance. These are all tools. They are very specific.
You would never summarize, “To climb the mountain we had to take our pants
off and hold hands,” because it was a minor—though essential—component of
the entire climb. On the other hand, strategic and sometimes tactical ideas are
often described in your summary: “We decided to reach the summit via the
south ridge and had to cross a difficult snowfield and a dangerous river to get
to the ridge.”

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required