4 ms·
Good test coverage and test-first philosophy can make this problem go away, but it always requires that you didn’t make an error in your tests. I always found t
by klmr 8y ago
Good test coverage and test-first philosophy can make this problem go away, but it always requires that you didn’t make an error in your tests. I always found this argument bizarre: I write tons of tests but I know that I’m fallible, and writing such tests is time-consuming. Why not let a static type checker do the work for me, with less chance of error?
- twoquestions 8y agoThat's another reason I like (good) static types, it's a bunch of compiler-included documentation and testing that I don't need to write!
- erik_seaberg 8y agoAlso a good reason for defining and using the most specific subtypes possible. In some domains, "this arg is a string" is useless for validation or documentation because everything is a string. Is it really a URL? a UUID? a serialized timestamp? a property name?
- woolvalley 8y agoThat's called something being stringly typed, and it's a code smell. You make URL classes, UUID classes, timestamp classes, enums, etc to replace the strings.