|
|
|
|
|
by kerkeslager
2223 days ago
|
|
> You should still have tests, but IMO tests that are just checking that a string is a string are The correct completion to this sentence is "irrelevant.", because that's not what anyone is proposing. The fact is, behavioral tests catch a lot of type errors even without intending to, and more to the point, if you test all the behavior you care about, then you don't care if there are type errors, because they only occur in situations where you don't care. |
|
Contrast with Scala, where using Either (which can be Left or Right):
If for example one forgets a branch: Or to follow the Elixir tuple pattern more closely: The typo also gives an obvious type error: Caveat: still learning Elixir and my Scala is rusty, so there might be better ways of doing the above. :)