(no title)
crgwbr
|
7 months ago
Python type hints are hugely valuable both as a means of correctness checking, but also just as a means of documentation. It strikes me as incredibly shortsighted to say you can forget about types just because it’s a dynamic language. The types are absolutely still there and need thought about. They just aren’t defined or used in terms of allocation and management of memory.
david422|7 months ago
Yes, if they aren't in the code, it just means the programmer has figure out and carry that around mentally when reading or writing code.
eduardofcgo|7 months ago
My point is that the CarBuilder is not a real type that relates to the business, but something that we had to create to encode some behaviour/rules.
Some function that validates that a dict is a valid car is much more explicit that lots of different builder classes in my opinion.