Re:Why Angular 2 Switched to TypeScript
by cheez on Saturday July 23, 2016 @10:12PM
(#12151896)
I was under the impression that typescript is a superset of javascript. Is that not the case?
[ Parent
| on HN ]
The title of one of the article sections is literally "TypeScript is a Superset of JavaScript" ...people do still read before commenting, right?
Just wondering why you can't use React directly if that is the case
In order for TypeScript to understand the types it is interfacing with (especially in the case of libraries) there has to be a type definition created for each library. Dismissing my complaint because "TypeScript is a superset of JavaScript" shows a lack of understanding regarding how the system works.
It is. I've not written anything in it other than a few simple tutorials, so I'm not an expert, but from what I've read you can drop to straight JS in your TS source code.
Re:Why Angular 2 Switched to TypeScript
by abritinthebay on Saturday July 23, 2016 @11:25PM
(#12152096)
It is, but that means less than most TS advocates realize.
I mean Objective-C is something like 97% a superset of C... doesn't make the transition any easier.
There is a huge difference between 97% superset and 100% superset. JS is valid TS without changing anything. The transition is easy.
Re:Why Angular 2 Switched to TypeScript
by abritinthebay on Monday July 25, 2016 @09:09PM
(#12162705)
Actually there is only a 3% difference. Which isn't actually that huge (most not hugely complex C programs are valid Objective-C programs, at least with a couple of minor tweaks).
As I said - it's a silly marketing point that isn't convincing anyone already not convinced by TypeScript and they'd do better to drop it as a talking point.