DEV Community

Discussion on: What Do You Think About Types?

Collapse
 
itr13 profile image
Mikael Klages

I very much prefer static or inferred typing, the more static testing a language has, the less time I lose on running the program until I notice a simple issue. In the worst case I (or somebody else) might not notice at all until much later.

Some IDEs have less reliable autocompletes when using dynamic typing too, which can be another point of slow-down.

The bigger the codebase, the higher the chance of unintuitive typing, and the more developers, the more chances each of those unintuitive typings have to make somebody do a mistake.

Collapse
 
solkimicreb profile image
Miklos Bertalan

I very much prefer static or inferred typing, the more static testing a language has, the less time I lose on running the program until I notice a simple issue. In the worst case I (or somebody else) might not notice at all until much later.

This sounds nice. I usually use vanilla JS with a linter which catches a lot of stuff without running the code. I guess the same would be true about static typing.

Some IDEs have less reliable autocompletes when using dynamic typing too, which can be another point of slow-down.

Yes, I feel like JS autocompletion is far from perfect. (I did not spend much time on setting it up though.)

The bigger the codebase, the higher the chance of unintuitive typing, and the more developers, the more chances each of those unintuitive typings have to make somebody do a mistake.

Honestly, I can't think of an occasion when I checked another dev's code and types would have helped me understand it faster. I either know the correct type on an instance or have to go through a lot of code to understand what the dev wants. (I wouldn't trust interfaces when the code is messy.)