Thinking Like A Computer: Part 1: Pseudocode and Algorithms
In order to solve problems with any programming language, we write code that tells the computer what operations to execute and in what order. The order must be very specific – remember the computer is not very smart – it simply follows our instructions.
Pseudocode
- Allows you to ‘get your ideas down’ as step by step code-ish statements, without getting bogged down in the specifics of a particular language’s syntax.
Algorithm
- Name given to a defined set of steps used to complete a task or solve a specific problem.
For instance you could define an algorithm to make a cup of tea.- You start by filling the kettle, then place a tea bag in the cup and so on.
- You start by filling the kettle, then place a tea bag in the cup and so on.
- You can think of this very much like a cooking recipe. If you follow the recipe exactly, you will end up with the produce of that recipe.
- In computer terms, an algorithm describes the set of steps needed to carry out a software task.
- Algorithms are *not* computer code, a programmer using 'C++' can use the same algorithm as someone programming in 'Java', they use the same steps, just coded differently.