On this page
Computational Thinking & Abstraction
Prev: foundations | Up: foundations | Next: State, Variables & Scope
Rel: Modularity, Cohesion & Coupling
Ref: Wikipedia — Computational Thinking
Tags: #public #prog #programming #foundations
Contents
Decomposition & Contracts
Every program solves a problem by breaking it into smaller, composable sub-problems with explicit inputs, outputs, preconditions, and postconditions:
Input Data -> [ Validate ] -> [ Transform ] -> [ Persist / Emit ]
Good decomposition isolates what a step guarantees (its interface) from how it achieves it (its implementation), so internals can be rewritten without breaking callers.
Abstraction Boundaries & Invariants
- Abstraction hides irrelevant detail behind a simpler model (e.g., a file path hides disk sectors; a hash map hides buckets and probing).
- Invariants are truths that must hold before and after every operation (e.g., "a sorted list stays sorted", "an account balance never goes negative"). Designing data structures that make invalid states unrepresentable eliminates whole classes of bugs.
Linked from
Related notes
- tuts/programming/foundations Linked here; links to this page; shared tags: #foundations, #prog, #programming
- tuts/programming/foundations/state_variables_and_scope Linked here; links to this page; shared tags: #foundations, #prog, #programming
- tuts/programming/software_design/modularity_cohesion_and_coupling Linked here; links to this page; shared tags: #prog, #programming
- tuts/programming/foundations/control_flow_and_composition shared tags: #foundations, #prog, #programming
- tuts/programming/foundations/functions_and_recursion shared tags: #foundations, #prog, #programming
- tuts/programming shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/complexity_and_big_o shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/linear_and_hashed_structures shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/problem_solving_patterns shared tags: #prog, #programming