|
|
|
|
|
by throw10920
1612 days ago
|
|
Why does adding types result in any more coupling than what exists already? If your client and server both treat field "temperature" as a string for protocol version 1, and then the client upgrades to protocol version 2 and temperature is now a float, the server has to be modified anyway, type system or no type system, because otherwise it'll break. If anything, the type system helps to expose the fact that the client and server now disagree about the type of a field, which is helpful. |
|
Because the client and server now share a code base. The client requires the server to run.
> If your client and server both treat field "temperature" as a string for protocol version 1, and then the client upgrades to protocol version 2 and temperature is now a float, the server has to be modified anyway, type system or no type system, because otherwise it'll break.
If the data interchange format changes then yes both the client and server need to change. But if either the client or the server wants to coerce temperature to a different type they are free to do so. As long as the conform to the interchange format the internal representation of the data is irrelevant to third-parties.
In a world where types are shared, updates to the server necessitate updates to the client even if the client doesn't want to change (and vice-versa).
> If anything, the type system helps to expose the fact that the client and server now disagree about the type of a field, which is helpful.
The coupling should receive the credit not the type system. Regardless this undoubtedly true. Two isolated pieces of code don't know what the other is doing. You need to test and you need to write design docs.