Everyday Computing Advanced Computing The Internet At Home Health, Mind & Body Making & Managing Money Sports & Leisure Travel Beyond The Classroom
Certification
Databases
Networking
Programming
Moms, Dads, and Grads -- Win $500!
Beginning Programming For Dummies, 4th Edition

Before You Write Your Program


Adapted From: Beginning Programming For Dummies, 4th Edition

Design your program before you start writing it. That way you don't waste time writing a program that doesn't work or that solves the wrong problem and isn't worth trying to salvage afterward. By planning ahead of time, you increase the odds that your program actually works and performs the task that you want.

The following four items are crucial to consider in designing any program:

  • The problem: What problem does your program solve? If you can't clearly state what your program does, you won't know how to design it.
  • The user: Who's going to use your program?
  • The target computer: Which computer do people need to run your program? Is it a Windows computer, a Macintosh, a mainframe, a computer running Linux, a handheld Palm or Pocket PC, or a supercomputer?
  • You: Are you going to write the entire thing yourself or get help from others? If you're going to get others to help you, which parts of the program are they going to write?

The problem

Every program solves a problem. A tax return program solves the problem of organizing and filing your taxes. A word processor solves the problem of writing, editing, formatting, and printing text. Even a video game solves the problem of keeping people amused.

A program is only as useful as the problem it solves. Most programs simplify and automate an existing problem, such as a money management program that simplifies organizing and paying bills instead of using paper and an adding machine. The goal of any program is to make a specific task faster, easier, and more convenient. The only way reach that goal is to identify what task your program is trying to solve in the first place.

The program's users

If you're the only person who's going to use your program, you can pretty much make your program look and act any way you want, just as long as you know how to make it work. But if you plan to give or sell your program to others, you need to know who's going to use it.

Knowing your program's typical user is critical. If users don't like your program for any reason, they're unlikely to use it. Whether the program actually works is often irrelevant.

By designing your program with the user in mind, you increase the odds that people use your program and (you hope) buy a copy for themselves.

Even if you write a program that works perfectly, users still may ignore it because they don't like the way it looks, they don't understand how to give it commands, it doesn't work the same way as the old program they currently use, the colors don't look right to them, and so on. The goal is to make your program meet your users' needs, no matter how weird, bizarre, or illogical they may seem (the needs — not the users).

The target computer

After you identify the user, you need to know what type of computer the user intends to run the program on. The type of computer that your program runs on can determine which computer languages you can use, the hardware that your program can expect to find, and even the maximum size of your program.

If you're writing a program to run on a Macintosh, for example, your program can take advantage of sound, color graphics, a large hard drive, and plenty of memory. You may need to rewrite that same program drastically, however, to run it on a smart phone with its limited sound capability, much simpler color graphics, and limited amount of memory and storage space.

If you can copy and run your program on another computer with little or no modification, your program is considered portable. The computer language that you use to write your program can determine its portability. That's why so many people use C/C++ — C and C++ programs tend to be more portable than other programming languages.

Your programming skill

When designing any program, consider your programming skill. You may get a great idea for a program, but if you're a beginner with little experience, writing your program may take a long time — if you don't give up out of frustration first.

Your programming skill and experience also determine the programming language that you choose. Experienced programmers may think nothing about writing entire programs in C or C++. But novices may need to spend a long time studying C and C++ before writing their programs, or they may choose an easier programming language, such as BASIC.

Some novices take the time to learn difficult languages, such as C/C++, and then go off and write their program. Others take an easier approach and choose a simpler language such as Visual Basic so they can create (and market) their programs right away. Don't be afraid to tackle a heavy-duty language such as C/C++, but don't be afraid to use a simpler language such as Visual Basic either. The important goal is to finish your program so you can start using it and (possibly) start selling it to others.

Many programmers create their programs by using a language such as Visual Basic and then later hire more experienced programmers to rewrite their programs in a more complex language such as C/C++, which can make the program faster and more efficient.

Related Articles
Polishing Your Development Tools for Cocoa Programming
Working with Interface Windows in Cocoa
The Technical Details of Writing a Program
The Life Cycle of a Typical Computer Program
Enhancing iLife with AppleScript
Related Titles
Software Project Management For Dummies
Design Patterns For Dummies
Windows Server 2003 For Dummies
C++ For Dummies, 5th Edition
Visual Studio 2005 All-In-One Desk Reference For Dummies