|
|
|
|
|
by auslegung
1717 days ago
|
|
It's a matter of speed. If you can get good at types in a short period of time, that will probably make you go faster in the longterm because you won't have a certain category of bugs. But if not, then just use JavaScript. You can always convert JS to TS later. In fact you can use TS now, but write JS. It will just work. Then as you begin to feel more comfortable with features of TS, you can begin using them. If you write JS, you are supposed to write a bunch of tests to catch possible regressions that TS's type system would catch for you at compile time. But tests are always a tradeoff; they take a little longer today to write for being able to move faster and more confidently later (this assumes you're writing good tests. Bad tests are generally worse than no tests). |
|
Caveat, you kinda have to already be thinking about types while writing JS for this to work. Highly dynamic code can be much easier to write in TS from scratch than rewrite from JS.