2 ms·
In general, I suspect you'd get more benefit from starting new projects with TypeScript than "converting" existing ones. The module/class/types system tends to
by itsnotlupus 11y ago
In general, I suspect you'd get more benefit from starting new projects with TypeScript than "converting" existing ones.
The module/class/types system tends to push you in certain direction for your overall design, compared to a more amorphous vanillaJS.
Even then, the language features don't replace coding rules and discipline. To pick one feature, protected and private members are little more than polite suggestions in typescript, and can be bypassed easily if that's culturally acceptable in your dev team, losing the benefit of well defined interfaces between chunks of code.
If Typescript feels generally useless and even a hindrance to a team, it's very possible that team is working outside of the bounds Typescript is meant for.
For example, I can certainly imagine a tight knit bunch of crazed coders writing fantastic JS code that really doesn't fit in a java-like development model.
If that's the case, you'd probably want to think about why your team migrated to Typescript in the first place, and what you were hoping to gain from it.
The generated boilerplate complaint surprises me a bit. Typescript produces very little extra code, and has almost zero runtime overhead.
There's an 5 liner __extends helper function, but that's about it. Most of the time, a line of TS maps to an essentially identical line of JS.
I understand that's becoming less true with the fancier syntactic sugar of recent releases, but we're still in the same general ballpark.
(and of course, the extra code melts away if you're able to target higher ES versions.)
The learning curve bit really depends on your team's background. Folks coming from many non-JS language will have been exposed to modules/namespaces, classes and types. They will be able to write reasonable code with typescript for a while before even realizing JS has this strange and intriguing prototype mechanism, although it can be a bit of a shock when the day comes, and an ancient JavaScript bearded one sits them down and gives them The Talk about what lurks in the basement.