Monthly Archives: October 2017

The Principles Of Programming

Posted by admin on October 12, 2017
Software / No Comments

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”

 – Eric S. Raymond, Open source defender

The Principles of Programming are:

  1. Everything is about communication.
  2. Every program models a reality.
  3. Programs handle data.
  4. Every program can be reduced to a command list.
  5. Every program can be reduce to Input – Process – Output.

Principle 1: Everything is about communication

Everything is about communication, between us and the computers and between programs that run in them. It’s all about communication, you tell them what to do and they answer you, you speak to them in a way they can understand and they communicate the result to you in a way you can understand.

Whitout communication there’s nothing. Can you imagine the modern world without the Internet? We’d be using the “foot network” still. Well, Internet is a bigger scale of what happen inside the computers. A program have to communicate with many other programs in order to everything runs smoothly, from open a file to send an email, everything is communication.

Principle number 2: Every program models a reality

Have you made a plane’s model or a ship’s model? Basically you make a plane, emulating the reality. That’s the same with the programs.

Think about the most used operating system by personal computers: Windows. At the beginning, Windows was made for office workers, everything in its environmente was designed for the sake of user familiarity: The desktop, the calculator, the folders, the files, etc. Early versions of Windows even used to have a special folder called “Briefcase”, where you could put the files you need in travels.

The whole Windows software use to model a reality: The office workers reality. Every moder application model a reality, from the home software through Office Suites till the ERP’s that models business administration, and the virtual relity video games, that model a sensorial reality.

Every program you write will model a reality. To the process of take a reality, separate it in parts and create a model we call it abstraction.

Principle No. 3.- The programs handle the data, information manipulated by the programs

Tongue-twister? Not, but almost. Making a clear difference between the applications and the data is fundamental in programing. A clear example is MS Word: Word.exe is the application, the file *.docx is the data. The computer programs execute commands and calcutations with the data. The data files are storage for structured information.

The diferentiation, altough obvious, it’s very importan because allow us to separate the reality thart we’re going to model it in two fundamental parts: The data and the computer program, and believe it or not, in the professional but non-technical word, causes confusion.

 

Principle No. 4.- Every computer program can be reduced to a sorted list of commands.

Every application is no more than a command list, really. Any program, any language, for example, a simple sum operation, the instructions will be like the following:

  1. Get the operands from the user.
  2. Execute the sum calcultation.
  3. Show the output.

This is a list of instructios, commands, that must be executed in that specific order for the computer to do its work properly. Change de order or skip one and the result will not be the same.

Principle No. 5 Every program is based in an Input, a Process and an Output

Every computer program take an Input (string, numbers, files, etc.), applies them a Process (arithmetichal, logical, financial operations, etc.) and produces a result, an Output (screen messages, a file written, an email sent, etc).

 

Any more complex program can be compound of many program or functions that can be reduced to the same Input -> Process -> Output.

The sum program is a good example:

  1. Take an input (the numbers)
  2. Applies them a process (the sum calculation)
  3. Produce an output (the sum result)

 

Every time you have problems in software development, take a deep breath and return to these principles, they will light up your problem and surely you’ll be able to find a solution.

Next step is understand how computers work, and then how the programs work too, in order for us to know what are we doing when we code and remove most of the gray areas, but before, a quick reminder:

  1. Everything is about communication.
  2. Every program models a reality.
  3. Programs handle data.
  4. Every program can be reduced to a command list.
  5. Every program can be reduce to Input – Process – Output.