DEV Community

Discussion on: TypeScript before JavaScript?

Collapse
 
bhaibel profile image
Betsy Haibel

Hmm. We often think of TypeScript as a superset of JavaScript -- as JavaScript with types. But it's just as valid to think of it as a subset of JavaScript. It's JavaScript without the dynamism that skipping a type-checker can give you. There are all kinds of dialects of JavaScript, and only some of them are compatible with the style that TypeScript enforces. So, you might not learn how to think about JavaScript written in different styles!

I'd also be concerned about not really learning what the border between JavaScript and TypeScript is. I work with a lot of early-career Rails developers. Folks who learned Ruby first and then Rails tend to be more successful. Folks who learned the two of them at the same time often really struggle with figuring out what's Ruby and what's Rails. Not knowing what Ruby is "on its own" can really distort their sense of what's possible in Ruby.

I'm not saying that you should put off learning TypeScript! You sound pretty enthusiastic about it. But learning only TypeScript might mean stumbling into some uncanny valleys when you start working with Other People's JavaScript.

Collapse
 
deciduously profile image
Ben Lovy

First off, thanks for the back-and-forth :) I really appreciate it!

That's a great point - I think I've already started running into that fuzzy boundary when I've tried using frameworks. Most of my TypeScript experiments have been pretty vanilla, just learning how the canvas works and things like that, but a few things I tried to do with a TS/React project proved trickier than expected.

It seems like, once again, the fabled missing ingredient is Other People! Funny how that works. Another goal of mine for the near future is a first PR, maybe I should focus on some plain JS codebases to explore.

Collapse
 
bhaibel profile image
Betsy Haibel

Give yourself some credit -- the canvas can get pretty vicious once animation frames are involved!

Thread Thread
 
deciduously profile image
Ben Lovy

Oy - I more meant vanilla as in free of external dependencies but you are not wrong!