DEV Community

Discussion on: Static Typing or Typescript

 
kayis profile image
K

I'm not saying static typing is bad. ReScript seems like a step in the right direction.

Thread Thread
 
peerreynders profile image
peerreynders

Sorry QA perspective, I don't really care that it is a struggle, I'll take 15%.

That "struggle" does diminish "return on investment". And opportunity cost means that effort invested in the struggle may be more effectively spent elsewhere.

Then there is the risk of adopting a technology that could be "end-of-lifed" at the drop of a hat. Microsoft and Google regularly stop supporting their technologies. Flutter is the only thing keeping Dart on life-support - so while the TypeScript user-community seems large enough it isn't clear that there is enough will, enthusiasm and critical mass to continue the product if Microsoft bows out.

Then there is the issue that while there may be a sufficient body of developers singing the praises of TypeScript in terms of "Developer Experience" only very few people seem to be evaluating the quality, volume, and performance of the code generated by the compiler even though they directly affect the non functional aspects of the end product - which can enhance or diminish the end product's core functionality.

Using type-aware tools doesn't replace learning about type-driven development (classes are no substitute for types) which typically requires working with something like OCaml or Haskell. Once you've been through that ringer even your JavaScript should be better (though type annotations and static analysis should be helpful).

Thread Thread
 
kayis profile image
K • Edited

Very good points.

Thank you!

Thread Thread
 
jessekphillips profile image
Jesse Phillips

My first post seemed to disregard tho concept of deminishing returns. I do think their is a limit but that isn't what I'm seeing with Typescript. My initial return is surely beyond reasonable, but that doesn't the end result isn't.

Many would probably consider the return on functional languages to have a demished return, especially now that so much has been brought into our more frequented languages. I straddle that fence as I have yet to dive deep into one.

But if we had a company push to switch to Haskell with a few developer buy-in, I would not be complaining about the struggle it puts me in to learn those languages.

Thread Thread
 
peerreynders profile image
peerreynders

Many would probably consider the return on functional languages to have a diminished return, especially now that so much has been brought into our more frequented languages.

Again that is another one of those fallacies - functional programming isn't about the presence of features but sometimes the absence of features and more to the point an adjustment in thinking.
While OO is supposed to be about class, responsibility and collaborator functional programming is about solving problems through data transformation.

From that perspective learning a new paradigm in a multi-paradigm setting is problematic because of the familiarity trap - you will always tend towards familiar patterns of thinking unless the constraints of a single paradigm force you to change your thinking. This is most dramatically reflected in the Scala community - teams using Scala as "a better Java" who have no hope of understanding/maintaining code written by the "I'd rather be working in Haskell" teams.

I found the easiest way to learn functional programming was through something like the Erlang MOOC (simply because you didn't have to to worry about types, type classes, laziness etc.) and later the OCaml MOOC for statically typed functional programming. (In the absence of those Learn Functional Programming with Elixir might be worth it).

But if we had a company push to switch to Haskell with a few developer buy-in, I would not be complaining about the struggle it puts me in to learn those languages.

That's not how it works from what I've seen. Typically the leadership of an organization is already convinced that a particular language is their "secret weapon" and then they hire people already competent with it or who show enough promise to be successfully trained in it.

Thread Thread
 
jessekphillips profile image
Jesse Phillips

Unfortunately this familiarity trap is the driving force around user interface design. Due to familiarity we got C, C++, Java, C#, ORM, Typescript.

And while typically the language is chosen early on and the company forms around it, the context here is with Typescript and this very much can come through as a push onto the majority of existing devs (hiring to Typescript for replacement of those who choose to leave). My example of Haskell was not realistic but used as it is my parallel to what javascript devs would be going through.