Hacker News new | past | comments | ask | show | jobs | submit login

This is a classic example of when to use the Value type pattern. You are in fact arguing for stronger typing (String is too limited here).

If you language makes that problematic, it is the fault of the language implementation, not a problem with static typing.




The people writing "dynamic languages suck" blog posts are merely unaware of how much dynamic typing they do every day in their statically-typed languages. And yes, I am arguing for stronger typing. And for getting rid of null.

(I've seen plenty of Haskell programs that are not compile-time checked for, say, XSS problems, even though it's trivial to do that with the type system. The problem is that nothing is ever automatic; if you want to write the best possible code, you have to make it a goal and carefully execute that goal. There is no silver bullet.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: