Unit tests don't provide any kind of safety. They're just a confidence thing.
Static typing is pretty much the only way to get type safety AFAIK... it's just that most languages we actually *use* don't implement static typing very creatively. Haskell does a lot of inference for example, but Java does not.
But this is because of the functional thing right? if your language is functional it is possible to infer things because you can see what is going to be returned. If it's not functional then you cannot logically prove the result of any expression and therefore need dumbass label based static typing.
So that's the problem... either we find a way to make FP more usable or we carry on down the dynamic route.
Discussion (8)
Type safety yes, necessarily static typing? Hella naw.
That's what unit tests are for...
I agree with DannoHung here. Type safety and static typing are not the same thing.
Unit tests don't provide any kind of safety. They're just a confidence thing.
Static typing is pretty much the only way to get type safety AFAIK... it's just that most languages we actually *use* don't implement static typing very creatively. Haskell does a lot of inference for example, but Java does not.
But this is because of the functional thing right? if your language is functional it is possible to infer things because you can see what is going to be returned. If it's not functional then you cannot logically prove the result of any expression and therefore need dumbass label based static typing.
So that's the problem... either we find a way to make FP more usable or we carry on down the dynamic route.
I like "nice" for this.
I've not tried nice. Can you make some claims about it so we can learn it?
Groan! It's java.
Claims inspired by this comment
'nice' (the programming language) is not JavaHints directed type inference is what we need.
Sometimes the "hint" can be "must be of type xxxx".