Spaghetti Programming without a Plan In the early days of programming, most programs were fairly short and simple. A typical program might just calculate a mathematical equation, which to a computer, is just a little more challenging than adding two numbers together. To write such small, single-task programs, programmers would typically start typing commands in their favorite programming language with little planning, just to write a program quickly. Unfortunately, many programs aren’t just written once and then used for- ever. If a program isn’t working exactly right, or if the program needs to do something new that the original programmer didn’t include, you must take an existing program and modify it. Modifying an existing program sounds simple, but it’s not. First, you must understand how the program works so you’ll know exactly how to modify that program. If you try modifying a program without understanding how it works, there’s a good chance you could wreck the program and keep it from working, much like ripping out cables from your car engine without knowing what you’re really doing.

After you understand how a program works, the second step involves writing new commands into the existing program. Now, here’s where the problem occurs. Take an existing program and modify it once. Now take that same pro- gram and modify it again. Now take that same program and modify it 20 more times, and what do you get? Most likely, you’ll have a mish-mash collection of code that works, but isn’t organized logically,
Modifying a program several times by yourself might not be so bad because you probably remember what you changed and why. But what happens if seven other programmers modify the same program seven different times and then none of them are around to help you understand what changes they made? If you guessed you’ll wind up with a bigger mess than before, you’re right.