How to write a program ?
Well, some just go and write some code... Actually, it doesn't work that way. Writing a program require first to understand few concepts and most importantly necessary planning actions and an ability to design.
It can be broken down into seven steps [ See C Primer Plus ] :
1-> Define the program objectives
You shall understand what the program requires to do, the ins and outs. Your vision on where you want to land is primordial and prior to write any code.
2-> Design the program
You can now design the code in how it is going to meet the requirements set by the program objectives. What will be the look of the UI ? What would the user requires in order to deem the program efficiently workable fulfilling his needs. Remember, we inevitable build a program for a user not for ourselves and surely not for the sake of building it. The architecture of the program is going to be designed accordingly.
3-> Write the code
This the phase when you can now start creating something meaningful translating your designful architecture into clean coding syntax. This action will be written on a text editor or something more structured such as an IDE where the further steps can be processed.
4-> Compile
Compiling is crucial as it will translate the source code into machine code making it executable by the computer. It actually consists of tedious instructions to the CPU(Central Processing Unit) expressed in a numeric language.
5-> Run the program
Running the program is the stage that comes when the source code is compiled. The executable file is the program that runs.
6-> Test and debug the program
Test and debug is a crucial phase. It is often overlooked by programers when it really shouldn't. Just because a program runs doesn't mean it works as requested. It consistently needs recurrent testing to see if the program behaves accordingly to the user needs. In this process, we may find bugs.
Debugging is the action of finding and fixing bugs and errors generated by the program.
Initially and that goes back to phase 3, a block of code shall never be written if it cannot be tested in a first place. An orthodox software engineer would act in such manner.
That is the reason why we shall execute a dive and conquer approach when writing code. It consists of writing a small block of code and testing it immediately. Committing to this practice will make the writing and building of your software a much enjoyable and secure experience. It will also minimise the amount of bugs you will find when finally testing the overall source file.
7-> Maintain and modify the program
Maintaining the program is key because as the users repeatedly use the program Therefore its architecture and structure will be put to the real test. This will inevitably cause bugs and errors, that will require Software Engineers to revisit its design and fix the new bugs or simply adding new options into the game.
It is not because you have written, ran, and tested the program that it is completely free of maintenance. Maintenance is actually the most expensive phase of a program because its survival throughout times depends on it. The user will require new options and features so that the program is up to date and running efficiently. Look at iOS today -> We are using Catalina 10.15.4 and it consistently and constantly gets optimised providing new updated versions including bugs fixings and new tools.
---------------------------------------------------------->
To conclude, The 7 steps are basic and an efficient process to write a program. However, you don't have to fall through this management process via the waterfall methodology. You might be going through it jumping around from one stage back to another. That is closer to a V methodology. Fort instance you test a block of code, and if there is a bug, you go back at it and redesign it before writing it again. AGILE is also a great approach. That is really up to the team.