DEV Community

Discussion on: IE 11, the Modern Web, and You (Featuring StencilJS)

Collapse
 
scott_yeatts profile image
Scott Yeatts • Edited

It's about half and half. Strong typing exists because the language wants to prevent you, the supposedly highly skilled and experienced developer, from doing something dumb. It restricts expressive power and speed in favor of stability. I feel the same way about Object oriented languages. Why would I restrict myself to one paradigm, when (no matter what language I use) there is a good use-case for OO, functional and even procedural techniques in almost any application.

JavaScript's strength is actually what many would call its weakness... duck typing and expressive power. You lose a lot of freedom when you restrict that.

It was facetious because of course I see the benefit of TypeScript (especially for large teams). Forcing consistency through language-level contract rather than structural convention (I'm reminded of how many times I had to remind people to use the revealing module pattern for AngularJS services... and then having to explain what that was, what design patterns are and why they are useful in that specific context, the benefits, etc... more times than I care to admit) but at the same time there's a reason Atwood's Law isn't "anything that can be written in Java will be". TypeScript is a tool like any other.

Give me a small team of highly skilled engineers in a 100% ES6 environment, I might not use it. Make me the one senior leading a team of 10 junior engineers and I'll reach for it in a second. Single developer environmemt with complete control of the stack? Maybe I'll try Elm or maybe I'll write Vanilla JavaScript so I can write dead-simple code without worrying about classes and types. I guess it's about applying the rule of least power in a way it wasn't necessarily meant for. If I NEED TypeScript, I use it. If I don't, I don't. When my tools REQUIRE TypeScript because it's the flavor du jour or because THEY needed it for their use-case, then that forces me to need it, rather than their tool doing what they do and presenting an API that I can easily consume with JavaScript or Elm or FORTRAN or whatever is best for my use-case. All these tools are an effort to compile down to vanilla Javascript anyway, so we should focus on trying get to the point that we don't NEED TypeScript, not just assuming that we will need it in every project.(Yes, FORTRAN was a joke, too :D)
EDIT: Written from my phone while waiting on my son to finish breakfast... so please excuse any grammatical errors. Any stupid things I say are probably still dumb though :P