2 ms·
> In a micro-services architecture it happens often to see the same data exposed with types that are often very different You mean micro-services that use dyna
by abalone 12y ago
> In a micro-services architecture it happens often to see the same data exposed with types that are often very different
You mean micro-services that use dynamic instead of strongly typed APIs? That's really more a critique of such architectures than the facility of static typing.
> Tell me, what does a String tell you? What does a Double tell you?
It tells you you can't use a String where a Double is needed, without unit tests, from the very moment you type the reference in your IDE.
You're correct that it doesn't eliminate all possible problems such as validating the unit of measurement, and that it's not sufficient documentation in and of itself. But that's not the goal of static typing. It's there to eliminate a very large swath of problems through simple declarations in code.