3 ms·
Python is an example of adding types after the fact. I don't know the specifics of your situation, but gradually typed languages do not offer the same guarantee
by kagakuninja 3y ago
Python is an example of adding types after the fact. I don't know the specifics of your situation, but gradually typed languages do not offer the same guarantees as languages that have static type checking from the beginning.
Replacing types with tests adds giant amounts of boiler-plate code, for little benefit.
- t43562 3y agoMy experience is that tests model the expected behaviour and that type systems cannot. Therefore I get lots of value out of tests where types are an impediment. Static typing from the beginning just sets me into a big design up front problem where I try to anticipate the flexibility that I will need and I start building lots of boilerplate abstractions that end up never being used or restricting me later. I find it useful to write imperfect code with only the constraint that it is testable and then revise the structure and any types I need as it becomes evident that they are valuable in the context.