3 ms·
I don't think 'type unsafe' is the only way to enable decoupling. For adding new commands, it can be done in a pretty type safe way. The problem is that the `IC
by pca006132 4y ago
I don't think 'type unsafe' is the only way to enable decoupling. For adding new commands, it can be done in a pretty type safe way. The problem is that the `ICommandHandler` may be used in a lot of places expecting different parameters, so they try to simplify the interface by using `any` as the parameter type.
> Static typing is really a form of testing
No! Static typing is not a form of testing. Static typing or static analysis, is an approximation of you program behavior, because it is undecidable in general. Depending on the properties of the type system, you can guarantee that you program doesn't go wrong if it is well-typed, where the definition of 'go wrong' depends on the type system. On the contrary, testing can check the behavior of your program with respect to a set of inputs, and it doesn't guarantee anything outside that set of input. You are doing state partitioning by doing a static analysis over your code to determine what tests you may need, and test some of them.