COMPUTATIONAL THINKING
A brief summary of common sense
What I'll cover
- Abstraction
- Thinking Ahead
- Procedural Development
Abstraction
Abstraction is all about removing the unnecessary parts of a problem to make it easier to solve. That's pretty much it, apparently Euler was really good at it and discovered some stuff about bridges.
Some examples of abstraction would be the use of functions to hide the nitty gritty details of how something works from the programmer who can use a function without worry about how it actual works.
Another example is the use of object oriented programming to encapsulate the properties of say a car: colour, brand, speed, etc....
Thinking Ahead
I thought this one was fairly trivial - it's good to plan what you're going to need to program and consider before actually coding everything.
This means that the inputs and outputs of a function should be considered before writing the actual function. It is also good to document any preconditions to a function - does it work even when blah blah blah? what checks are necessary before calling the functions.
This requires consideration of places where a function/program may fail and how to avoid this.
A key part of thinking ahead is in caching. If you are going to use the same piece of information many times it is worth storing it in cache instead of re-calculating it each time. To know which things to store in cache you need to think ahead!
Thinking Procedurally
This is all about breaking down a program into smaller less complex procedures. This comes hand in hand with the common programming paradigms we all know and love.
Modularisation is all about splitting your code into separate modules, each associated with a particular function within the wider scope of the program. This blatantly links to the process of decomposition - break problems down into manageable chunks which can each be tackled individually
wiki on this found here
- banana
- pear
- strawberry