Beginning Programming All-in-One For Dummies, 2nd Edition
Book image
Explore Book Buy On Amazon

Before you start writing a computer program, first take four critical steps to design it. By doing so, you don't waste time writing a computer program that doesn't work or that solves the wrong problem and isn't worth trying to salvage afterward. With planning, you increase the odds that your computer program actually works and performs the task that you want.

The following four steps are crucial to take when designing any program:

  1. Identify 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.
  2. Identify the user: Who's going to use your program?
  3. Determine 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?
  4. Determine your programming skill: 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?

Computer programming: Identify 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.

Identify the computer 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).

Determine the target computer for your computer program

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.

Determine 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.

About This Article

This article can be found in the category: