Your Thoughts About Types

Miklos Bertalan - Feb 23 '19 - - Dev Community

This week 7 devs made 11 comments about types. Big thanks to all of you!


My Impression

Most commenters favored statically typed languages with type inference which is not a huge surprise.

They argued that types help in auto-completion, documenting interfaces, and catching errors at compile-time. I have to agree about auto-completion but I think interfaces can be documented with decent naming too. I - and some other devs - also boasted that we never ran into type related errors in JS until someone threw in the good old "Undefined is not a function".

Most contra-side commenters mentioned the extra code as the biggest disadvantage of types. They also mentioned reduced flexibility, although I didn't really get answers for my question about cases where changing the type of something helped. I feel like most people think of the weakly typed nature of JS as a time saver, rather than a feature.

Ultimately you managed to make me curious about types. I tried to avoid them because of the extra bloat but maybe I played with the wrong code bases and became biased. I got tired of reading and writing obvious types but I am now excited to try how well a modern type system with inference can help me. A comment about pattern matching in ReasonML piqued my interest the most. I think I will start there.

Thanks for reading!


Next week's topic will be the Virtual DOM. See you on Monday!

. . . . . . . . . . . .