I don't think that's an accurate metaphor. Seatbelts are expressly a runtime solution to car crashes, whereas Python's type checking is a) only done during development (not even during build), and b) completely reliant on third-party tools.
If you're looking for a car analogy, I would suggest comparing Python type checking to installing speed cameras on the factory floor.
If car crashes still kill people, why wear safety belts?
I don't think that's an accurate metaphor. Seatbelts are expressly a runtime solution to car crashes, whereas Python's type checking is a) only done during development (not even during build), and b) completely reliant on third-party tools.
If you're looking for a car analogy, I would suggest comparing Python type checking to installing speed cameras on the factory floor.
The analogy would be mandatory inspections of certain components or manufacturing processes to see that rules and specs are followed while assembling.
Thats a bad analogy. A better one is should we check the breaks before (compile time) we start the car and drive down the highway (runtime).
At this point you either did check the breaks, or did not. If not you are out of luck if the breaks did infact not work.
Or you test the breaks as you stop to see that everything is clear as you exit your driveway and go into the street.
1 reply →
Because "all or nothing" is a bad idea.
How so? We have multiple languages with static types, and most know the insane benefit you get from having compile time guardrails.