This document contains background information for facilitators before they run the workshop with participants. It helps to understand the distinction between algorithm and programme as a basic requirement for programming.
Preparation time for facilitator
Name of author
Resource originally created in
We often hear about algorithms, in media, on the internet, etc. They are present in our everyday lives and are involved in the functioning of many services: online video playback, social network advertising and so on. However, many people don’t know what algorithms actually are. We will here define them, which will lead us to consider a range of programming languages. Some history… The word ‘algorithm’ comes from Al Khwarizmi (circa 820 C.E.), an influential Persian mathematician who introduced decimal numeration and elaborated basic related calculation rules to the western world. Essentially, algorithms go hand in hand with number manipulation. Today, they are not limited to working only with numbers but are used to affect more complex objects: images, texts, logical formulas…
‘An algorithm, quite simply, is a method – a systematic way to do something: sort objects, place towns on a map, multiply two numbers, find a square root, find a word in the dictionary. A general way to describe them would be to say that they identify procedures, series of actions or precise manipulations to execute in a sequence. This is the essence of an algorithm.’ (translated from Interstices).
A cooking recipe is a perfect example of a method: in each recipe a specific procedure must be followed. Each step of the recipe constitutes on operation of the algorithm.
Algorithms and programs: what’s the difference?
An algorithm is the general method whereas the program is a level higher, since the method is inherent in a given programming language.
This is the bridge between human and machine: it allows retranscription of the method in a form that is intelligible to the machine. Through programming languages, a programmer can conceive of methods which can be understood by computers. Why several languages? The programmer aims to communicate in a precise way a method that they have in mind. They therefore search for the ‘optimal’ language, which would satisfy the following criteria:
- Expressivity: allowing complex instructions to be expressed simply and clearly.
- Reliability: ensuring programs’ correct execution. This might involve verification modules or a grammar so clear that a bug could be easily spotted.
- Efficacy: execution in minimal time. If we go back to our cooking recipe example, we could think of efficacy as using a hand blender to mix soup directly in the pot rather than first needing to move the soup to a traditional blender.
Writing one perfect unified programming language is mostly inconceivable. This is why there are a variety, each of which serve a different function. Having languages designed for specific purposes helps limit errors in execution, accelerate results, facilitate retranscription of method, etc. Any new programming language necessarily invokes a new compromise – comes closer to an optimal solution without quite reaching it – for a given application.
Examples of programming languages
- Java is an object-oriented programming language developed Sun Microsystems in the 1990s. It remains one of the most popular languages.
- C is the oldest language still in use today, created in the 1970s. It serves as the basis for other languages, such as C#, Java…
- C++ is an intermediate level language which has object-oriented functionality and was originally created to improve C. C++ runs many very popular programs such as Firefox, Winamp and those of Adobe.
- Objective-C is a general-purpose and object-oriented language used by Apple for their operating systems and applications. It runs iOS mac OS as well as their programming interfaces.
- C#, pronounced ‘C sharp’, is a multiple-paradigm language developed by Microsoft via the .NET initiative. It combines principles of C and C++ to create a general purpose language.
- Python is a high-level programming language used for websites and mobile applications.
- PHP (Hypertext Preprocessor) is a free language used for the development of websites and applications.
Programming interface / API or Application Programming Interface:
An application programming interface (API) is a computing interface which defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. It can also provide extension mechanisms so that users can extend existing functionality in various ways and to varying degrees. An API can be entirely custom, specific to a component, or it can be designed based on an industry standard to ensure interoperability. Some APIs have to be documented, others are designed so that they can be “interrogated” to determine supported functionality. [From Wikipedia]
See here for some examples.
Here are some well-known examples of algorithms that we may use frequently.
- Google’s PageRank. This algorithm determines the order in which pages appear when you search for terms on Google.
- Facebook’s Timeline. This method consists of showing you content that corresponds to your profile, your friend network, your past reactions, etc.
- Round Robin algorithm. This is widely used in the domain of IT, since it allows computers to determine which tasks should be prioritised.
- Netflix algorithm. Personalises your homepage to suggest content you are more likely to watch given your profile, your past viewing habits, etc.