A ride to a sentence
transcript
A rider books a ride. It goes to Please call at the gate. At 3:20 in the morning. And no part of the code complained.
The constructor takes five values, in order. Pickup, drop, stops, note, time. The drop and the note are both strings. Swap them by accident, and it compiles. It even runs, and ships.
The drop is now a sentence. The note says Airport. And the time is 03:20, before service opens. No rule ran, because no rule had a home. Callers checked some, and skipped others.
By position, the reader guesses which value is which. Is that 1080 minutes, or a price? By name, each value says what it is. A swap is visible.
Three stops at most. A note of 40 characters or fewer. A time between 6 am and 10 pm. One place checks them all.
Name every value at the call site. Check the rules once, in one place.
Full breakdown in the lecture.