Computational thinking

Computational thinking

Computational thinking is not following through an algorithm in your head but rather thinking how to solve the problem.

The steps to try and do that are:
  1. Rephrase the problem as computational - make it solvable using an algorith.
  2. Construct the required algorith

The average computational thinker won't be satisfied with any basic algorith but rather the most efficient and correct. To prove the efficiency and correctness of the algorithm, the programmer uses logical reasoning, tests and feedback from users.

Hence, having computational thinking is very useful for a programmer to understand and think about solutions for various formulas. That proccess of computational thinking into code is called automation of abstractions.

Abstraction

Representational abstraction is a representation without unnecessary details such as:

As you can see, abstraction allows us to visualize different situations easily rather than given in full detail, which is very helpful when applied to programming languages.

Abstraction's application to high level programming languages.

At the time this webpage is written, abstraction is the most important feature of high level programming languages, as we don't need to write algorithms in machine code but rather an abstract version of it.
There were several generations, call that an evolution of programming languages, of abstraction used in coding:

  1. The first instance was the use of mnemonic codes - a set of instructions that allowed the user to visualize abstractly the computer operations and use them.
  2. The next instance were BASIC and FORTRAN, which allowed the user to use statement like "A = 6 + X" instead of working with accumulator like mnemonic codes used to, making the abstraction even clearer!
  3. Finally, we can take a look at any high level programming language such as JAVASCRIPT or Python and see how well they abstractly show the code writing system.

A famous example of abstraction is the city Königsberg and its bridge problem. To read how Leonhard Euler solve this problem,

Data Abstraction

Data abstraction is used a lot in coding, as it helps to do certain operations on a certain data. The more famous examples are queues, stacks and linked lists.

Thinking Ahead

The most abstract way to solve a problem is an input to the computational problem to an output, while some preconditions are present, as we need to make sure the algorithm won't crash or output wrong values.

Reusable Program Components

While writing a code, the programmer may proceed to use various functions from different libraries, to perform functions without the need to code them. In bigger projects, programmers may create their own libraries, as they might need different commonly used functions to be used in different components, making usage of well tested functions hasten the project and its coding.

Caching

An aspect of thinking ahead used by OS rather than programmer. Caching is a temporary storage used to store recent data/instructions which may be needed to be accessed quickly
Web caching is an example of caching, storing recently viewed HTML webpages or images, giving fast access to them, saving bandwidth since there is no need to download the pages again.

Thinking Procedurally

Each computational problem has various components, and we need to break them down to sub-problems which can be broken as well and so on. Breaking into these small sub-problems allows the coders to maintain easily and managebly the project.
A good example of that is a Hierarchy Chart below that simplifies abstractly the classification of accounts, essentialy breaking the problem into small chucks: