How to Use This Book

 < Day Day Up > 



It is strongly recommended that everyone read about the major illnesses. For the novice programmer, it is also a good idea to read this book from front to back. You will be encountering many of these decisions and problems in the years to come. For the experienced programmer, some of the material might be familiar to you, so feel free to skim it. However, try not to dismiss any of the sections outright, as there are many useful tips included that you might not have thought of for improving your coding. Some of the included anecdotes are also amusing, and would you want to miss those?

There are two main parts to the book: major illnesses and minor illnesses. The major illnesses are three of the most common problems in programming. Their effect is felt everywhere, and can cause very serious problems during development. Each major illness is discussed in detail and is likely to be the root cause of one or more of the minor illnesses. The minor illnesses are problems that are smaller in scope, but nonetheless still common and problematic for developers. Less common than the major illnesses, they can be equally destructive if they are not caught and handled early. Here is a short description of each of the illnesses:

Premature Optimization: Optimizing too early in development has many disadvantages, and can make development unmanageable toward the end of the project. Yet, this is one of the most common illnesses that plague programmers and projects.

CAP Epidemic: Duplicating editable information quickly leads to arduous maintenance tasks and nightmares when trying to make changes, but too often cut-and-paste is seen as a quicker and easier solution. Along with premature optimization, these make up the majority of programming errors I have seen.

NIH Syndrome: Fear is a powerful thing, and programmers fear any code they have not written. While this fear might occasionally be justified, we often throw the baby out with the bath water in our automatic reaction to using other programmer’s code.

Complexification: Almost all programmers love a challenge, and coming up with a complex solution to a simple problem is such a challenge. The problem is that a much simpler solution will often do just as well.

Over Simplification: Those who have been bitten by Complexification often overcompensate by trying to remove all complexity, thereby making things too simple. This usually results in shifting complexity elsewhere and often making the new code more complex than necessary.

Docuphobia: If we wanted to be writers, why did we major in computer science or mathematics? Unfortunately, when we do not document properly, others cannot use our code, and we might even forget what we did over time.

i: i? Are you having trouble figuring out what that means? Well, the same problem occurs when trying to read code with names like that. One might call it self-obfuscating code.

Hardcode: Can you afford to hire a programmer to sit with every other member of the design team anytime a change needs to be made? If not, then all those hard-coded values are going to cause you some problems.

Brittle Bones: Ever try to build a house on top of a swamp? It is similar to trying to build an application on top of buggy libraries and a brittle framework.

Requirement Deficiency: Do you want to reach the end of a project only to find that the customer wants more? To avoid this, make sure that all the requirements are laid out, even the ones that customers often forget to mention.

Myopia: Why solve today what you can put off until tomorrow? The problem is that you often have to do work to put the problem off when you could have solved it right the first time.

Each illness follows the same structured layout to make referencing easy. An illness is broken down into Description, Symptoms, Prevention, Cure, Related Illnesses, First Aid Kit, and Summary:

Description: Short description of the illness and its effects.

Symptoms: Details on how to spot this illness.

Prevention: Techniques to prevent this illness from causing errors.

Cure: Techniques to recover from problems caused by this illness.

Related Illnesses: Other illnesses that occur with or because of this illness.

First Aid Kit: Tools to help in the prevention and curing of the illness.

Summary: Summary of the illness and how to deal with it.

You should read the entire illness on the first pass, and then skip to the specific section later to aid in recalling particular information.



 < Day Day Up > 



Preventative Programming Techniques. Avoid and Correct Common Mistakes
Preventative Programming Techniques: Avoid and Correct Common Mistakes (Charles River Media Programming)
ISBN: 1584502576
EAN: 2147483647
Year: 2002
Pages: 121
Authors: Brian Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net