Physics I / Functions and modular decomposition
Practice question · Multiple choice

A 300-line script computes a rocket trajectory in one giant block. It works. Why would a good engineer still break it into functions?

Hints
  1. Imagine finding a bug in the drag calculation. In which version do you know where to look?
  2. Decomposition is for humans, not machines, the computer would happily run a million-line block.
Show the answer

B. Each piece can be understood, tested and fixed alone

Why

Functions are the units of understanding, testing and reuse. The machine is indifferent, but the next human (usually you, three weeks later) can grasp compute_drag() in isolation. Managing complexity, not speed, is the core skill of programming.

Read the lesson: Functions and modular decomposition →

Practise Functions and modular decomposition

The app has 11 more questions on this lesson, and keeps your place in the course. Physics I is free to start.

More questions on Functions and modular decomposition