Computational thinking
This course covers computational thinking as a systematic approach to problem solving, built on four pillars: decomposition, pattern recognition, abstraction and algorithmic thinking. Each pillar is explained with Ruby and Rails examples, such as service objects, Result values, layered controllers and domain-driven design. Lessons cover top-down and bottom-up decomposition, data and code patterns, leaky abstractions, pseudocode and the three building blocks of algorithms. A final case study applies all four pillars to a course recommendation service, with a six-step workflow and a checklist.
What you'll learn
- ✓Breaking problems into independent, testable parts using top-down and bottom-up decomposition
- ✓Spotting recurring structures in data, code and problems, and extracting them into reusable solutions
- ✓Designing abstractions with clear interfaces that do not leak implementation details
- ✓Writing pseudocode with sequence, selection and iteration before translating it to Ruby
- ✓Applying the four pillars with Ruby tools such as Enumerable, modules, service objects and query objects
- ✓Following a six-step workflow and checklist to solve a problem from statement to verification
What is computational thinking?
Computational thinking is not about thinking like a computer. It is about developing a systematic approach to problem solving that works whether you are writing code, designing a system, or debugging a production incident.
Read the full lesson free →Curriculum
7 lessonsWhat is computational thinking?
Introduces the four pillars of computational thinking with Rails examples and contrasts problem-solving strategy with coding.
Decomposition: breaking problems apart
Shows how to split problems into independent, testable pieces, using heuristics, Rails layers and a quiz feature example.
Pattern recognition: spotting similarities
Covers recurring patterns in tables, services, controllers and problems, and how a spotted pattern becomes a reusable abstraction.
Abstraction: hiding complexity
Explains levels of abstraction, what makes a good or leaky one, and Ruby techniques from methods to DDD domains.
Algorithmic thinking: step by step
Defines algorithms, uses pseudocode with sequence, selection and iteration, and translates a reminder email algorithm into Ruby.
Computational thinking in Ruby
Maps each pillar to Ruby features such as Enumerable, blocks, modules and query objects, ending with a dashboard query.
Solving real problems: the full workflow
Applies a six-step workflow to build a course recommendation service, then traces examples and edge cases to check it.