4 ms·
Sigh. I really wish people would just accept the fact that JavaScript is a dynamically typed language and stop making things unnecessarily difficult.
by mmckelvy 7y ago
Sigh. I really wish people would just accept the fact that JavaScript is a dynamically typed language and stop making things unnecessarily difficult.
- d357r0y3r 7y agoTo people who understand what static typing does and the problems it solves, this statement is the equivalent of "Hitler did nothing wrong."
- codr7 7y agoYou're ignoring the fact that many already went through that phase and ultimately decided that complexity is the only enemy worth fighting in software. It always pays off to take a closer look at the things you can't think or say, to ask why.
- d357r0y3r 7y ago> You're ignoring the fact that many already went through that phase and ultimately decided that complexity is the only enemy worth fighting in software. No, this doesn't match my experience. The people who resist types are usually web designer types who haven't actually worked with type systems at all so they view it as ivory tower nonsense - complexity for complexity's sake. There is the occasional person who worked with Java in college and hated it, and assumes that every language with types is just a variation on Java. This is, of course, not a very informed position.
- lhorie 7y agoPersonally, I've worked with both Flow and Typescript, plus Java, C# and Actionscript professionally, and C, C++, D, and Rust for fun (and also Ocaml, SML and Haskell to a lesser degree). And I still choose to write plain JS sometimes for various reasons. I have many co-workers with several years of work experience who share caution against static typing kool-aid. Anyone that pits types vs no types as if it's some sort of competition or some elitism thing is probably forgetting to consider that there are in fact perfectly valid scenarios where one is more suitable than the other (and vice versa)
- codr7 7y agoI've been writing code on a daily basis for over 30 years; in umpteen different languages, some more typed than others. And I'm still not very fond of having types shoved down my throat, nor any other kind of restrictions. We've been building computers and writing code for quite some time now, so long that some of us are beginning to notice the repetitions. The fact that experience is so often dismissed begins to explain the mess we're in.
- saagarjha 7y agoGodwin's law strikes again. Static typing is great, don't get me wrong, but it's not always the right solution. There are cases where runtime flexibility can be useful.
- eropple 7y agoTypeScript isn't statically typed, though. I make sure to keep my type boundaries clean but I haven't shied away from dropping into `any` if it was faster to express. I did then get better at TypeScript over time and remove most of those cases, though.
- Klathmon 7y agoThat's why I love Flow and Typescript so much. They are as opt-in as you want them to be. I've seen a team use typescript, but have zero types in most of their files, they just used it from libraries to get some IDE autocomplete and some very small typing on core areas.