The steering wheel
Abstraction
The analogy
You steer a car with a wheel. You never think about the rack, the pinion or the hydraulics — the wheel hides all of it and gives you one simple thing to turn. Good abstraction leaves you only the controls you actually need.
Visualizer
Peeling back the steering wheel
step 1 / 7ABSTRACTION LAYERS
Steering wheel — the only thing you touch
Steering column
Rack and pinion
Hydraulic assist
Tyre against road
You turn the wheel. As far as you are concerned, that is the whole mechanism.
def steer(angle):
_column_rotate(angle) # you never call these
def _column_rotate(a):
_rack_translate(a * 0.6)
def _rack_translate(mm):
_hydraulics_assist(mm)
steer(-15) # the only line you writeCheck yourself
Abstraction mainly reduces…