So how does it work?
A programmer is a person that writes a source code in a programming language to create programs. The programming language makes use of real words to execute some of the commands so that the language is easier for other people to read. Programming languages use punctuation just like any other normal language and are “compiled”, meaning that the computer is able to translate the source code into another language that is faster and easier for the computer to read but a little more difficult for a human to read! Programs need to be very carefully written with no mistakes so that the program does not crash when a user tried to perform a task that the programmer did not design the program to do. Problems in programming are called “bugs” and even a small mistake can cause a significant problem.
These three concepts are the basic logical structures in computer programming:
The running of certain instructions in a specific order.
Making the right choices.
Doing the same thing on more than one occasion.
These basic concepts form the ability to deal with outputs and inputs in order to store data and are the tools that are needed to solve the majority of computing problems.
Types of programming languages
Programming languages come in various types and most languages do not follow one type alone. This can make it difficult to assign a specific type for each language. The table below describes examples of what types are allocated to each section. These are the most well-known examples of that type:
|High-level versus low-level||High-level programming languages require much less knowledge when it comes to the hardware compared to low-level programming languages. High-level programming languages normally require some kind of interpreter to convert the source code into a low-level programming language.
|Declarative versus Imperative programming
|Programming languages that are declarative means that they are describing a problem but usually do not say how the problem can be solved. The description of the problem uses logic and solving the problem often looks like automatically proving a system of logical axioms. Some examples of this programming language are:
Imperative programming languages are used to describe a system of state changes, meaning that at the start the program is in a certain state and the computer is given steps that it needs to follow in order to perform a certain type of action. When the steps are followed it causes the program to “change state”.
Declarative languages are usually shorter and safer while imperative programming languages are a lot more common as they are easier to use.
|Functional vs. Procedural
|Functional programming resembles a type of function in mathematics. This programming language receives input together with some information and uses this information to create output. There is no in-between and it will also not change anything that is not related to the computation. Procedural programs are able to specify and describe sets of steps or state changes.
|Stack based languages take a look at some of the program’s memory almost as if looking at a stack of cards.
Unfortunately there are very few things that can be done with a stack. Basically a data items can be put on top of the stack. When this happens s is called a “push”. A data item can also be removed from the stack – this is called a “pop”. You are able to look at the item on top of the stack without removing it. This operation is called a “peek”.
|Object-oriented programming languages are able to place data and functions that change data into a single unit. This unit is referred to as an “object”. Objects are able to interact with one another and change the data of another object. This is called encapsulation or information hiding. Most programming languages are object-orientated and allow for this style of programming. Examples of these programs are:
These objects are pieces of the memory that have the same structure and can be used again and again. The objects are made up of properties and methods and are created from templates called classes. The class defines all the properties and methods that the objects will have. Objects that are created from a class are further called instances of the class and can extend to another class meaning that it will use all the properties and methods of the class but can also add its own.
|Flow oriented programming is the way that programming is seen as connecting different components which are able to send messages back and forth. A single component is able to be part of different programs without the need to be internally changed.
|There are some languages that have scientific computing as their main purpose. Examples of this are:
– MATLAB which is made by MathWorks.
– GNU Octave which is an open source version of MATLAB.
– R Programming language which is used in the field of statistics.
– Wolfram Mathematica which is made by Wolfram Research.
|LaTeX and SATySFi are programming languages that help with the creation of documents.
The Rules of Programming
It is important to note that every programming language has rules informing the programmer as to what they can and cannot do. These rules include:
- Correct numbers – this refers to the types of numbers and how large or small they are allowed to be.
- Words – this refers to words that are reserved and are case sensitive.
- Various limits as to what the programming language is able to do.
Most of the languages have official standards that are used to define the rules when writing the source code and some programming languages have two or more standards that need to be adhered to.
Programming is an extremely creative task and there is no wrong or right way in which to solve a problem. There are many choices that the programmer is able to choose from and even though one way may seem better than the next neither one is wrong. Programmers who have the right skills and good experience are able to code software that can solve many problems. Ultimately the possibilities are endless, and the possibilities cannot be constrained if you use your imagination.