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

> What about the drawback of static types that's mentioned?

> > Static type checking makes you think more seriously about your program > which helps to further reduce bugs.

That wasn't mentioned as a drawback; it was mentioned as an argument for static types that people give that the author thought was an invalid argument.

> The point is, in statically-typed languages, dynamic typing (and gradual typing) is just a design pattern. Not only is the expressiveness problem a strawman (we can write dynamic code in a static language, or trivially parse a dynamic "front end" language into an equivalent static form), but static languages give us more expressiveness (dynamic types are just regular data, "dynamic type errors" are just regular branches), more safety (by limiting which parts are dynamic, checking (static) types and totality automatically, etc.) and require no special language features. We can do this right now with existing languages.

Yes and no. Yes, all the things you said are formally equivalent. In practice, though, they are very different. Sure, you could make them equivalent, but who actually writes programs that way? And if you don't actually write that way, then the practical difference really matters.




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

Search: