Creativity and problem solving is a very general skill set
and can be applied in a multitude of applications. In Think Like a Programmer, an Introduction to Creative Problem Solving,
V. Anton Spraul, a programming instructor, looks at how to approach computer
programming through a lens of creativity. Written for new programmers or those
just wanting to take their coding to the next level, this book takes a
comprehensive look at the thought process that goes into writing a successful
program.
Spraul is quick to point out that the hardest part of
learning a new programming language is not the syntax (the text that you
actually type), but rather the algorithms that go into making a program that
gives you the results you actually want. While the book is chalk full of
examples of more specific problems that a computer programmer might be asked to
solve, Spraul continuously comes back to five main principles that a programmer
must constantly keep in mind: having a plan, restating the problem, dividing
the problem into smaller pieces, looking for analogies, and not getting
frustrated.
There are a large number of different steps that can be
taken to solve a problem, some of which can be wrong ones. When solving a
problem, if no plan is formulated “you are simply hoping for a lucky break.”
The best way to develop a plan is to restate the problem. In this way, the
parameters become clear, and precise, calculated steps can be taken to solve
the problem. As Spraul points out, “planning allows you to set intermediate
goals” which are smaller and easier to solve.
Sometimes the formulation of a plan is not so clear. In this
scenario, it is best to look for analogies. Many problems have similarities.
For example, Spraul works through the solution to the classic “Fox, Goose, and
Corn” problem, where a farmer must transport these three items across a river.
Later on in the book, Spraul introduces a new problem that he created, the “Quarrasi
Lock.” In the introduction statement, Spraul uses obscure names and an odd
situation to try and throw the reader off. However, the problem is an exact analogy
of the “Fox, Goose, and Corn” problem and can be solved in the same way.
Recognizing analogies can save a lot of time and frustration.
One thing Spraul does well in getting his point across is
the layout of the book. Even though the book is intended for those whole are
familiar with a programming language, anyone can benefit from the first
chapter. It is in the first chapter that Spraul first introduces his five
reoccurring themes mentioned above. No actual code is used in the first
chapter; rather, Spraul focuses on the basics of algorithms and looking at
problems in a more creative way.
As the book progresses, more and more programming knowledge
is needed to comprehend the material. While the chronological order of the book
is done well, one criticism I have of Spraul’s book is that it does progress
rather fast. I could see a beginning programmer struggling to keep up with the
level of algorithms used in the later chapters, syntax aside. For a beginner,
supplemental materials are most likely necessary to complement this book. That
being said, one nice thing about the book as a whole is that it can easily be
fact checked. All one needs to do to test Spraul’s code is to compile and run
it on a computer. This can also make it easier to follow Spraul’s logic as he
works through the different example problems.
As a student minoring in Computer Science, this book is very
relevant to me now in my academics. While I know the basics of programming
quite well, I am always looking for ways to improve the code that I write.
There are many different ways to write a single program, and some are superior
to others. Spraul has given me a lot to think about while trying to develop these
greater algorithms, not only for my classwork, but also for programs I write
for fun.
There is a lot I can take away from this book for my future
career as well. My hope is to someday own my own consulting, research, and
development company specializing in alternative energy. I think we face two
main challenges in energy today: source and distribution. Finding a better,
cleaner source of energy is where my Chemical Engineering degree will come into
play. However, it is just as important that we can put systems in place to
efficiently distribute energy. Computers and software will be an integral part
of these distribution systems, and so my knowledge of programming will be of
great use to me in my career. Starting to think more creative about the code I
write now will hopefully make me that much more advanced in the future.
While my review has focused mainly on the programming
applications of Think Like a Programmer,
an Introduction to Creative Problem Solving, I do not think it does the
book justice to limit it to one topic. Just as creativity can be applied in
many ways, a programming mindset can in turn be used to look creatively at a
wide array of problems. Approaching a problem while “thinking like a
programmer” means approaching the problem in a logical fashion. It means
looking at the problem in smaller, more manageable pieces, or looking for known
patterns. One could argue that every thought process we go through while
solving any type of problem is like an algorithm. As such, problem solving and
programming thought process are necessarily linked. The better put together and
more creative these thought processes or “algorithms” are, the better the
results.