Hacker News new | ask | show | jobs
by tyingq 1324 days ago
The external services are not always either explicit, or compliant about the content of said string. Follow this comment chain up, and you'll see mention of blinding casting to utf-8. The point I was making is that you don't always know what the encoding is.
1 comments

If the service doesn't send you back a string it doesn't send you back a string. End of story. You're continuously trying to complicate the issue by insisting that they're sending strings and that the client needs to guess their encoding. They are not and it does not.
Encoding was one example. But "string" is language dependent aside from encoding. Strong typing doesn't solve the inherent issue.
Strong typing never “solved” anything, except that is forces you to see the problem and solve it yourself, explicitly, instead of relying on weak typing to fudge the types for you.
Maybe. Ambiguity means some random bags of bytes pass as more than one type.
And the "Any" type covereth a multitude of sins.