The programming process
This post is dedicated to those people who are starting to learn how to program in C++. Here I cover the basic programming process, and how one can go about writing a short and decent C++ program.
Writing a computer program is like preparing a recipe. Ingredients are first prepared, then one goes over the preparation process. This involves mixing all the ingredients together in the proper order and in the right amount. After the mixer is ready, one goes over further preparation steps if needed. In the case of the recipe being a salad, no cooking is needed, but if one is preparing something that has to be cooked, well, then one cooks it.
A typical programming plan goes like this:
1.- Requirement definition.
In this step, the program requirements are defined for the programmer to have an idea of what the program should do.
2.- Specification of the program.
In this step, the main function of the program is defined. If the program is a calculator, then one has to specify the calculator functions.
3.- Code design
In this step, the algorithms to use and the class definitions are stablished. In other words, establish the foundations of the program.
This is the funny and most entertaining part of the programming process. One gets to type all that one wants until satisfied.
Once the code is typed in, and the compilation and linking process is finished, one has to run a test procedure on the program.
After testing, mistakes and other programming corrections are fixed. One also rethinks and/or refactors any piece of code which requires so.
The program is packaged and released. This publishing step can vary. It depends specifically on the kind of license the code is under.
A program is hardly ever finished. One can always add new features to a program, as well as do any corrections.
9.- Revising and updating
Like a recipe, one can always modify the ingredients or the method of preparation. Most of the times, a program also needs constant revision and updating.