4 ms·
TypeScript devs pushed their idioms to get it into ES6. Introducing optional typing to ES6/7 would be a good idea, but other C#/Java inspired syntax like "class
by frik 12y ago
TypeScript devs pushed their idioms to get it into ES6. Introducing optional typing to ES6/7 would be a good idea, but other C#/Java inspired syntax like "class" are a bit off-putting, if one loves the lean JS5 syntax. After all, JavaScript has prototype-based inheritance, so the new "class" keyword is weird (even if it's just syntactic sugar): http://en.wikipedia.org/wiki/Prototype-based_programming http://en.wikipedia.org/wiki/Prototype-based_programming
- tracker1 12y agoEven with prototype based inheritance I tend to avoid it all together in JS. Preferring to use generic object instances, with function based modules that can be composed (Ramda, ReactiveJS, etc) that works out being much better and easier to reason with in practice in my opinion. I agree that the class syntax seems a bit weird, but it isn't bad... It's a lot better than ES4/AS3 syntax in my mind, though ES7 (TypeScript/AtScript) seem to be moving in that direction.
- frik 12y agoYour are right. A little nick pick about TypeScript and I hope that other dislike its influence to ES6/7 too: Microsoft's mastermind behind C# and TypeScript: Anders Hejlsberg was the original author of Turbo Pascal and the chief architect of Delphi. In 1996, Hejlsberg left Borland and joined Microsoft. One of his first achievements was the J++ programming language. Since 2000, he has been the lead architect of the team developing the language C#. In 2012 Hejlsberg announced his new project TypeScript—a superset of JavaScript. I sincerely hope he stays away from ES7 - I don't like his syntax preferences. (ES4/AS3 syntax was already weird as hell, and good that it failed.) ES5/JavaScript 5 was so great and lean - so refreshing coming from C++/Java/C#. TypeScript feels a bit like a Trojan horse that emerges as ES7. As the linked article says "TypeScript: Is basically ECMAScript 6 plus optional type annotations." Or the other way around, they turned the beloved ES5 to Hejlsberg's TypeScript. So don't destroy ES7.