Computational thinking

Thinking is only computational when it's communicated to a computer.

Computational thought patterns reflect human thought

They are used in more than programming


  • Abstraction
  • In many ways, abstraction is a thought process that creates a framework for a concept that can then be modified. Being excellent at abstraction is being excellent at creating the right framework for the right project. The creation of a framework allows redesigns without starting from scratch. Fundamentally, this is what happens when we modify the original version of a Mac and Cheese recipe: the framework is there—we don’t have to create a brand new concept for cooking Mac and Cheese. Instead we can use the recipe we have, and only think about changing a portion of it based on a modification; in this case perhaps the addition of tuna fish.

    As in decomposition, abstraction requires meta awareness, critical thinking, and an inquiry process: asking questions such as who, what, why, where, when, and how.

    The importance of skillful abstraction increases in proportion to the complexity of work done. When taking on the task of drawing a blue circle, there is no depth to the project: pick a colour, pick a shape and go. In this instance, abstraction doesn’t matter.

    When building a quiz creator project that includes multiple subjects, multiple databases of questions, charts showing results and progress over time, different users, high score tables, and so on, abstraction matters a lot because there are different ways to organize the codebase: its organization depends on which part of the application will be used the most.

    In computer programming, abstraction saves space and time and, as a consequence, it  reduces errors.

    The use of abstraction gives a computer programmer options in the writing and problem-solving process by chunking the main ideas to be built in order for objectives to be met, while simultaneously doing away with minutia. In doing so, it avoids the creation of brittle code.

    As an example, if a programmer is writing a video game with 5 different types of enemies, he or she can write all the instructions for each enemy individually. Alternatively, the programmer can abstract to the concept of “enemy” and write instructions for all the enemies collectively, using variables and functions for how fast each enemy moves or how much damage each enemy does.

    Now, in expanding the video game, the programmer can just think in terms of “enemy” and what to do with that concept, rather than having to think about “enemy 1”, “enemy 2”, “enemy 3”, “enemy 4”, and “enemy 5”. In this instance, abstraction means that the programmer avoids needing to attribute either different characteristics to the same concept or needing to write the same characteristics for the same concept, five times.

    By only writing once instead of five times, the code becomes more robust and easier to maintain because the thinking is clear, logical, and organized. In applying abstraction, other thought processes, and computational logic, a programmer avoids the creation of brittle code.

  • Algorithms
  • An algorithm is a set of steps (e.g. a sequence of instructions) or a set of rules that is followed to meet an objective.

    Most people know the fastest route from work to home, for example, turn left, drive for 7 blocks, turn right, etc. This can be thought of as an algorithm—as a sequence of instructions to get from Point A to Point B. A different algorithm would be required for a program finding the most scenic route home.

    As a thought process, algorithms are important because they are an established means of solving specific types of problems, understanding that the result will be exactly the same every time a specific algorithm is used in a specific context. The nature of algorithms is such that they are reliable and repeatable. Becoming familiar with classes of algorithms and common algorithms avoids hours and sometimes weeks of thought work. Yet, it is always possible to create new algorithms if known algorithms fail to serve. Other computational thought processes such as pattern matching and abstraction contribute to identifying algorithms that could best solve specific problems.

    The goal in computer programming is to find the best algorithms. As in abstraction, the shorter a sequence, the fewer mistakes are prone to happen. In addition, fewer lines of code are easier to edit when mistakes do occur.

    Search engines such as Google use an algorithm (PageRank) to put a set of search results into order, so that more often than not, the result we’re looking for is at the top of the front page. The algorithm is responsible for sorting through and classifying information. In fact, there is an entire class of algorithms called sorting algorithms. Social media applications have their own algorithms used to create an enjoyable user experience. Moreover, recommendations made by Amazon, Netflix, and eBay are algorithmically generated, based in part on what other people (determined—by a program—to be similar to you) are interested in.

    Because we value good information, we value good algorithms. Indeed, information that comes from a computer program, website, or mobile app is often only as good as the algorithm powering it.

    Computer programming is about being presented with a problem and being able to build or create a solution in response. Being excellent at algorithms and algorithmic thinking means you are able to build and create solutions to more, increasingly difficult, problems.

  • Decomposition
  • Decomposition is a thought process that has us break down big problems into smaller, more manageable, parts. It helps us to solve complex problems and to manage large projects.

    Ultimately, decomposition makes for manageable and achievable projects—large problems are daunting, but a set of smaller, related tasks is much easier to take on.

    For example, if a school is putting on a school play (an objective that we refer to as a project), the project will be managed by decomposing (e.g. organizing, breaking down, or chunking) it into smaller, more discrete parts: advertising, set, script, production, tickets, rehearsals, and performance. Each part can subsequently also be decomposed. This ensures that no crucial areas have been missed as the bigger project is being completed.

    The ability to do excellent decomposition is predicated on an individual’s aptitude for meta awareness and asking good questions (e.g. who, what, where, why, when, and how).

    The relationship between meta awareness, questioning, and excellence in decomposition is seen in industries such as the gaming industry. In creating a video game, a computer programmer must consider absolutely everything that a game player will experience within the game. As a consequence, everything in a computer game needs to be decomposed prior to being programmed. Mastery of decomposition demands excellent critical thinking skills as well as creative ability—both of which are skills topping the “must have” list for the 21st century.

  • Design Thinking
  • Evaluation and meta awareness are the underlying skills of design thinking. In order to master design thinking, an individual must excel at both: making judgements in an objective and systematic way and doing so from the standpoint of various groups of people. As in much of the rest of computational thinking, exercising meta awareness and posing questions are crucial to developing good judgement.

    It’s important for a computer programmer to become expert at design thinking in order to write code that not only solves a problem, but that can be used easily by most people. If a program or a piece of software is difficult to use, it simply won’t be used. 

    Examples of questions that might be asked as part of a design thinking inquiry process.


    · Do you need more instructions or an information window to help a user know what to do on a specific page of your mobile app or website?

    · What does a ‘good’ animation look like—what are the criteria? Does my animation meet these criteria? How could I change it to meet more of the important criteria

    · How are users arriving at my website and travelling through my website? Are there any places where they drop off and go to another website before I want them to (e.g. before they have made a purchase)?

     

     

     

     

     

     

     

     

  • Pattern Matching
  • Pattern matching in programming is done for the sake of communicating observations about similarities in items and sets of items to a computer and is similar to pattern matching done in other disciplines.

    A programmer organizes these items in their code writing based on observed similarities. This is done by using and organizing the seven structures of computational logic.

    Ultimately, for the purpose of computational thinking, pattern matching has two parts.

    Part 1: Identifying items that are either identical or that have many similar characteristics.

    Part 2: Noticing and understanding the conditions in which these items exist.

    The better a computer programmer becomes at pattern matching, the easier it will be to create rules with computational logic and to solve problems.

    For example, if a programmer is building a shopping website such as Amazon, the website will display a seemingly endless list of items for sale. Although these items are different, they exist under the same conditions and have many similarities: a name, a price, product information, etc.

    Identifying these patterns allows programmers to determine things like what is in a shopping cart and how much to charge on checkout.

    Once a computer programmer has identified certain patterns, loops, arrays, objects, and conditionals (parts of computer logic) can be used to modify large groups of information based on those patterns. For example, knowing that all items have a weight, computer logic can use those weights to create shipping prices for each item, with higher prices for heavier items, but connected to real world costs for shipping.

    This human logic and pattern matching are communicated to a computer with real computer languages. The use of real computer languages in programming education is crucial in the free and full communication of human thought to computers. Using pattern matching and other computational thought patterns in programming leads to ease of use, effectiveness, and efficiency in applications.