4 ms·
After going back and forth between weak and strong (static) typing (php, js, java and scala) i would say weak typing lets you code quicker because you can be le
by Joeri 11y ago
After going back and forth between weak and strong (static) typing (php, js, java and scala) i would say weak typing lets you code quicker because you can be less explicit about what you're doing, but strong static typing lets you make code production-grade sooner because of all the additional checks which catch bugs. Weak typing feels more productive while coding, but when all is said and done often ends up being less so.
In php you can do strict typing at the function call boundary, which is where it really matters, but you need the discipline to do it consistently. I like scala's approach of inferring types as much as possible and only stopping you when you're trying to do something semantically impossible. Scala often feels like a weakly typed system while coding, which is why it's so fun. For that matter, functional style java 8 feels the same way some of the time.
I think the ideal system is strongly typed but maximally inferred to minimize verbosity and maximize coding productivity. Scala is too weird to be that language though.