VP Of Engineering at Flexperto GmbH·

We're still using JavaScript and Node.js, but try to stick with TypeScript for new services and modules. About the benefits of static typing much has been written, in short it:

  • offers better maintainability and discoverability of existing code bases
  • provides reasonable type safety, which frees us from writing a huge chunk of unit tests and mitigates a large set of problems that are caught in compilation
  • affords a new level of expressiveness via types

Nothing is without trade offs; we are aware of, and accept that:

  • fighting the compiler can be frustrating
  • it adds to the already large list of skills a web developer has to learn
  • it adds another piece to the already large set of tools necessary to get code from development to production
READ LESS
8 upvotes·2 comments·31K views
aleyrizvi
aleyrizvi
·
May 21st 2020 at 11:30PM

If one has to use typing, why not use a proper typed and compiled language such as go or rust for the backend?

·
Reply
Timm Stelzer
Timm Stelzer
·
November 10th 2020 at 11:45AM

The question isn't really "why TypeScript and not all these other staticly typed languages?" but rather "Why NodeJS and not another back end language?". We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. Then, going from there to TypeScript is a no-brainer.

Implying that TypeScript is not a proper typed language is a bit weird, especially mentioning both Rust and Go in the same sentence, Go isn't exactly the poster child for static typing (missing generics, for example, which TypeScript has). TypeScript is a decent language, it just needs to carry the baggage of JavaScript. On a personal note, I find TypeScript gets much more interesting in combination with fp-ts (https://github.com/gcanti/fp-ts) if one is into that sort of thing.

Regardless, I could see us to use Go, if we found performance issues we can't easily resolve in NodeJS. That hasn't happened yet. Until then, NodeJS is the more approachable language. Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages.

In summary: TypeScript is the easy choice, Go would be practical but is not necessary, Rust is an innovation we don't want to pay the price for.

·
Reply
Avatar of Timm Stelzer

Timm Stelzer

VP Of Engineering at Flexperto GmbH