Programming is how we as humans give instructions to computers on how to solve a  particular computation problem. It  involves coming up with a  step by step way to solve a given  problem and translating our solution into computer code in a  specific programming language such as Python , C , C++  and others.

Programming aims to automate a  task, such task can be simple as printing sum of two numbers or as complex as launching  spaceships or creating self driving cars.

With the rapid improvements in technology, the field of programming has evolved creating some of the most robust careers in existence today and has now become a part of our day to day life. Every time you turn on your laptop, phone or smart tv,  you are running a program that has been pre-installed  in order to generate the interface that you can interact with on your screen.

Choosing to learn programming today is one of those decisions that one will likely never regret.

Why learn programming?
  • it can be used to automate tasks which would otherwise take years to accomplish manually
  • It enhances problem solving skills
  • Computers are able to perform multiple tasks concurrently thus saving time.
  • Learning can be fun if you enjoy problem solving.
  • It is a highly on-demand skill.

Coming up with working computer programs involves several processes. 

Processes involved in computer programming

This processes  are also known as the software development life cycle

software life cycle

Analyzing the problem

As we said  programming is all about solving a well defined problem,a programmer  therefore needs to analyze the problem at hand and weigh the various solutions that can be used to solve it choosing the most suitable one.

The   step by step solutions to solving a problem are collectively known as an algorithm, a programmer  needs to come up with a suitable algorithm which if followed will solve the problem at hand. We will look at algorithms in a later tutorial.

Designing the solution.

After analyzing the problem and identifying the most suitable way to solve it , the programmer then needs to  structure and  visualize the solution in a way that is  unambiguous .

This is an important step because  the computer will do exactly what you tell it not necessarily what you intended, therefore the saying that computers are very stupid but very obedient.

This part also happens to be the hardest but it becomes easier with practice and experience since most software problems tends to repeat and the programmer can relate if he encounters a similar problem in future.

Coding

When someone mentions the word programming , What mostly comes to the mind of most people is actually coding. While most people use the terms interchangeably there is quite a clear difference between a program and a code. A program can be thought of as an idea and a code is manifestation of that idea in a certain programming language.

Coding involves typing a series of instructions in a text editor and saving them  in a file. The resulting series of instructions  are collectively known as source code.

Text editors are software which are made to ease the process of editing  and maintaining source codes.

Compiling

After writing and editing the code in a particular programming language, programmers want to see their program  in action.

A compiler is a special computer program which takes the source code ,and turns it  into the equivalent  machine code  before it is processed by the computer.

If the program is compiled successfully, the programmer can then run their program to see the results.

Debugging 

Rarely do programs compile successfully in the first run due to errors that the programmer made when writing the source code. This errors can be as trivial as forgetting to  close a bracket and other times the errors can be very hard to locate and can take hours or even days.

A program can also compile successfully but fail to produce the intended results.

The errors in our programs can be thought of as bugs  alias to how a bug can  hide in a machine and cause it to malfunction. Debugging as name suggests, is trying to find those bugs and remove them. 

Debugging is the process of locating  the source of errors in the source code and rectifying them.

Debugging is a trial and error method and there is no way  that we can be guaranteed that there is no bug in our program. Some people argue that there is no program in existence that is bug free.

bug classification:
  • Critical.   The program does not function at all.
  • Major . The program compiles but it doesn't function properly
  • Moderate . The bug causes the program to generate false, incomplete or inconsistent results.
  • Minor. The program functions as intended  except for very few cases
  • Cosmetic. The bug only affects interface or the appearance of the program not it's functionality.
Testing

Testing is proving that the program is doing what it is supposed to be doing.  For small programs , testing can be easy and trivial but as the program grows in complexity and functionality,  the likelihood of bugs increases and the programmer will need to write more sophisticated tests.

Testing is the only way  that we can confirm that our program is working properly . Programs without tests are said to be broken by design because the results produced cannot be relied upon.

Maintenance

Code maintenance involves modifying and  updating the source code  where necessary without breaking it or impairing  it's functionality.