Re:Scala: sharp and gets things cut
by mcv on Monday October 07, 2013 @12:55PM
(#6509528)
> Type annotations let you get the shape of the data structure out of your head and into code.
This is by far the best argument for static typing I've ever heard. I'm not a big fan of static typing (mostly due to Java). I like Scala, but I think its type system is way over the top.
For the most part, I care about rapid development, and you'll always need unit tests anyway, so they can also test your types for you. And Scala type matching in its builtin switch statements can always get my type back when I get handed an Object. With tools like that, I don't really need absolute type safety.
But getting the shape of your data structures out of your head, that's definitely an advantage.
This is by far the best argument for static typing I've ever heard. I'm not a big fan of static typing (mostly due to Java). I like Scala, but I think its type system is way over the top.
For the most part, I care about rapid development, and you'll always need unit tests anyway, so they can also test your types for you. And Scala type matching in its builtin switch statements can always get my type back when I get handed an Object. With tools like that, I don't really need absolute type safety.
But getting the shape of your data structures out of your head, that's definitely an advantage.