4 ms·
Sincere question: Don't you feel the lack of static typing?
by egeozcan 11y ago
Sincere question: Don't you feel the lack of static typing?
- bjz_ 11y agoWe've begun to use Elixir and Phoenix at work, and it's far nicer to work with than Rails - there's far less magic going on, and being functional, there is much less mutable state to keep in your head. That said, I still miss a rich type system. Typespecs can get you some of the way, but they're unreliable, and there's no support for parametrically polymorphic functions so far as I can see, which limits the usefulness of protocols for typechecking purposes.
- AnneOminous 11y agoStatic typing is not a single issue. It is several. From a high-level-language standpoint, static typing is a crutch. It isn't necessary, but it forces you to do things "the right way"... according to some definitions of the right way. It is possible to make mistakes without static typing that you would not make with it... but if you're careful you can also do some good things without it that you can't do with it. It all depends on whether you feel more comfortable with taking control or you feel the need for some restrictions to keep you "in line". From a purely performance standpoint, there is no question: static typing compiles/interprets to faster code.
- bjz_ 11y ago> From a high-level-language standpoint, static typing is a crutch I see types as a high-level design tool. They allow me to reason about a domain, and figure out how to structure things at a high level before delving into the implementation. Yes, performance is a great side-benefit, but it is not always the driving factor.