Programming Basics

Programming De-mystified


Some computers – such as laptops, ipads and phones - are general purpose computers in as much as they can be used for a range of purposes. Other devices, such as embedded computers, have just one job to, for example controlling a mechanical system.

Either way, computers have to be programmed to take an input, process that input, and produce an output.

Programming is done by a developer who writes code and then sends machine readable data based on that code to the computer.

The term ‘digital’ refers to the lowest level of processing in a computer – manipulating binary numbers. All digital media is derived from binary numbers, but programming in binary would be exceptionally onerous so programming works through intermediate steps.

First developers write algorithms using a language based on English. The languages developers use are called ‘high level languages’ because they abstract the programming instructions.

The process of converting an algorithm written in a High Level Programming Language into code readable by a chip is called compilation.

How Does Code Get Executed?


Programs are written in high level (close to English) source code, which is then compiled into an ‘executable’ format in binary. This executable is then invoked, most often by an operating system, which loads the program into memory, and then begins execution by moving control to the entry point of the program. At this point execution begins and the program then runs until it is terminated.

When the chip receives readable code, it can then process inputs into outputs as set out in the algorithm.

Figure 4. Executing code


Programming


Different languages have different jobs, and are therefore written in different ways. TIOBE is one of several indexes showing the popularity of different programming languages. The index below is for April 2020[i]

[i] www.tiobe.com



Figure 5. Top 3 most popular programming languages. Image, c/o TIOBE


At the top of the software ‘food chain’ are developers. They use languages to create different types of software packages.

Figure 6. The software ‘food chain'


Programs and Apps

The terms programs and apps are used interchangeably and mean the same thing. Software is another name for packaged pieces of code that performs a function. A platform is a group of technologies that are used as a base upon which other programs, processes or technologies can be run or developed. Some platforms allow developers to write code for them through something called an API – Application Programming Interface. An operating system is a specific kind of platform that enables programs to interact with hardware - examples include OSX, Linux, Android and Windows.

When we use an app on our phones or PC we are usually just aware of what we see on the screen, but this is just the tip of an iceberg. Behind most apps is a complex set of interconnected software services running across a range of hardware. Calling an Uber cab, for example, involves the interaction of a complex stack of software services across multiple locations.

A common software stack is called LAMP – Linux, Apache, MySQL and PHP. At the top of a LAMP Stack is the application – for example a mobile phone app written in Java. The PHP layer intermediates the Java app with the software layers further down the stack. Apache is a common web server software package that enables web sites and web services to run, and these services can be consumed by the Java app. MySQL is a database, and the PHP, Apache and MySQL services will all run on top of a Linux server far away from where the Java app is being used.

Figure 7. The business value ‘food chain'


Complete and Continue