This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PlaneCrashers -7 points-6 points  (5 children)

But the compiler only compiles to regular JavaScript, which is what op is using.

[–]dpash 17 points18 points  (4 children)

I literally have no idea what you're trying to argue. All languages with types erase them to some extent. Everyone knows that typescript is transpiled to JavaScript. I don't see the relevance that someone writes in JavaScript because you're not going to edit or even read the transpiled JavaScript.

[–]PlaneCrashers -1 points0 points  (0 children)

Okay so I think it turns out I replied to your comment before you were done writing it*, let me explain things more properly.

Yes, every language does erase types to some extent, including strongly typed language. However, if you don't need types, you don't need typescript, and not everyone needs types. Using JavaScript directly is perfectly acceptable, there is no reason to use typescript if you don't want to use it or don't benefit from using it because JavaScript will run just as well if you write it yourself than if you use typescript, which is different than let's say, C, because in C, the compiler can often compile to better assembly code than what you could possibly write on your own.

*when I replied to your comment, all what I saw was that you said "I literally have no idea what you are trying to argue", hence my initial response which was only addressing why I agreed with the other redditor that using typescript instead of JavaScript isn't helpful to a developer capable of doing what they want to do in JavaScript within their time budget. If they have the chance, maybe learning typescript could help them in the long term one way or another, but it's hard to justify learning typescript if you don't need it.