Live data from Hacker News

Announcing TypeScript 2.1

blogs.msdn.microsoft.com

41–50 of 226 posts

Re: Announcing TypeScript 2.1

#41
post #38

Been a Linux developer for ages C# was never my taste, I'm still a bit Microsoft-hatred as of now(Visual Studio Code is the only item I adopted for JS development, the rest languages I still use vi/Geany). How tightly TS is related to C#? That has been the main reason I had not tried TS seriously so far. Don't want to have anything to do with C#. I know...

They are not related at all, except in who is their original designer. However, if you are really so fundamentally opposed to anything and everything a certain language represents then you've got to hate a lot of languages for a really, really petty reason.

Re: Announcing TypeScript 2.1

#42
post #8

It's interesting to me that all of the initial reactions I've seen to this announcement have been around the introduction of async and object spread, which are available with babel, but the typescript specific features such as mapped types are completely ignored. I don't really have any particular meaning behind that observation, only that it tickled my funny bone a little bit.

Maybe it is me, but I feel like mapped types and keyof are terrible features, and using them would be a sign of a bad design/architecture. In general, I don't think using a string that represents a static symbol (such as the name of a var, an attribute or a class) is a good idea. I try to keep a simple stack (Typescript + NPM at the moment), and I prefer to wait for Typescript to have the feature I want, than to inst…

> In general, I don't think using a string that represents a static symbol (such as the name of a var, an attribute or a class) is a good idea.

Why? (Genuine curiosity here, not trying to be hostile or anything like that)

Re: Announcing TypeScript 2.1

#43
The easier imports solves my biggest issue with migrating an existing project over. I'd say TypeScript is "ready" now.

The last feature I'd want is an easy way to map nested json into classes rather than interfaces. Anyone know how?

Re: Announcing TypeScript 2.1

#49

Any plans to add C#-like extension methods to TypeScript? Or is there a way to achieve the same thing already? I know that a previous suggestion to add extension methods was closed as out of scope. But maybe it's time to revisit that, since TypeScript is now doing significant code transformations for downlevel await support.

JavaScript already allows you to do something very similar to extension methods by extending prototypes.

OTOH, a function accepting an object which implements a specific interface as a parameter will make your code much more easier to extend, instead of modifying the prototype of a concrete class.

Post reply on HN