3 ms·
Honestly I think the bug catching aspect of static typing is its least useful property. (Useful, but not like, amazing -- you can write assertions on a type in
by overgard 10y ago
Honestly I think the bug catching aspect of static typing is its least useful property. (Useful, but not like, amazing -- you can write assertions on a type in a dynamic language). I think the good thing about static typing is it makes a code-base much easier to navigate and much more self documenting. I spend most my time navigating other peoples code. I know you can get most of the reliability of static typing with extensive test suites etc., but that doesn't help my IDE and it doesn't let me look up parameters at a glance. I used to be firmly in the dynamic camp, but having to maintain other people's javascript definitely made me do a 180.
- eyelidlessness 10y ago> you can write assertions on a type in a dynamic language You can, but you can't get any guarantee that said assertion will never fail.
- Bahamut 10y agoWriting assertions has a runtime cost that isn't present when using something like TypeScript. Granted, that benefit is probably minor, but it is a benefit in TypeScript's favor.
- mbrock 10y agoIt does have a compile time cost and that's not negligible... although with all the heavy transpilation going on these days, a bit of type checking might drown that out. At a previous job we tried TypeScript but it took around 20 seconds to build our front end. Since then I hear speed has improved.