Live data from Hacker News

TypeScript: a language for application-scale JavaScript development

typescriptlang.org

291–300 of 316 posts

Re: TypeScript: a language for application-scale JavaScript development

#291
post #224

It seems the analyser to infer the types of your vars is fairly easily fooled. The following code compiles, but prints out "Hello undefined": interface person{ firstname; lastname; } interface apple{ colour; } function hello(p : person){ alert("hello " + p.firstname); } var aPerson = {firstname: "joe", lastname : "blogs"}; var anApple = {color: "red"}; var foo; if(true){ foo = anApple; } hello(foo);

When you paste this into the Playground, and hover over the `var

Re: TypeScript: a language for application-scale JavaScript development

#292

Earlier quoted context omitted.

I heard a kid complaining about Java being slow yesterday. People remember their first experiences for a long, long time after they stop being true.

Well, Java is slow. The JVM startup times are what people notice.

You're assuming he was making a nuanced argument and not just flashing gang signs.

Re: TypeScript: a language for application-scale JavaScript development

#293

Earlier quoted context omitted.

hmm, mind sharing why? My limited Mono experience was that getting a simple ASP.NET application running on a Linux VPS was, without prior Mono experience, one hours' work. I was pretty impressed by this.

As meanguy pointed out, the Mono team lost Novell's backing -- arguably, they never had it in the first place. Xamarin is now focused entirely on mobile, to the detriment of the core CLR implementation and web. Not that I blame them in the least. I've been a huge fan of Miguel for years, and they're doing great things in the mobile space. I just can't in good conscience invest heavily in Mono knowing that it's essent…

Mono is now backed by Xamarin. They got something like 12M in VC funding this summer and appear to be on fire. From what I've seen, the future of cross platform .NET looks great.

Re: TypeScript: a language for application-scale JavaScript development

#294
post #293

Earlier quoted context omitted.

As meanguy pointed out, the Mono team lost Novell's backing -- arguably, they never had it in the first place. Xamarin is now focused entirely on mobile, to the detriment of the core CLR implementation and web. Not that I blame them in the least. I've been a huge fan of Miguel for years, and they're doing great things in the mobile space. I just can't in good conscience invest heavily in Mono knowing that it's essent…

Mono is now backed by Xamarin. They got something like 12M in VC funding this summer and appear to be on fire. From what I've seen, the future of cross platform .NET looks great.

Click the Xamarin Dev Center link. You'll see Android and iOS but no Linux. They're focusing on mobile client tools.

They never got the full stack running on the server and they punted most of the Windows-specific client stuff from the start.

They landed on a super smart subset and seem to be kicking ass with it. A C# compiler with some odd omissions and cool enhancements + native bindings to iOS and Android equals a damn useful tool. If you're building .NET or even Java backends it's certainly a very sane way to hook into them from Android phones and tablets in the enterprise.

But it's not a cross-platform .NET environment by any stretch and certainly isn't on the path to becoming one.

Re: TypeScript: a language for application-scale JavaScript development

#295

Earlier quoted context omitted.

Variable scoping, unavoidable global namespace pollution, === vs == insanity, etc.

But how do libraries help you from that?

Kitchen sink libraries like jquery + jquery ui save you from having to write much JavaScript at all beyond basic glue code. The less JavaScript I write, the happier I am. This is in stark contrast to other languages I work in where I actually like to roll my own frameworks.

Re: TypeScript: a language for application-scale JavaScript development

#296
post #281

Earlier quoted context omitted.

Conversely it's a bad idea to spread yourself thin in multiple languages but master of none. Having said that, I'm pretty much tied to Java since 2000 and haven't seen anything wrong... yet. In fact, I'm determined to get better in Java everyday (memory model, JVM, concurrency, better design, etc). Side note: I'm also learning pure "modern" JS just because there's no choice on the client-side.

> Side note: I'm also learning pure "modern" JS just because there's no choice on the client-side. Knowing Javascript, GWT is a win.

I've done GWT for about 2.5 years from version 1.x to 2.x. I'm not sure I prefer one or the other.

GWT development is a bit painful to setup and to work day-to-day.

It's nice to have the similar Java structure and to be able to write unit-tests to test the app via MVP patterns but I'm still not sure it's a big win for me going forward. Especially when the founding members have left the team.

Re: TypeScript: a language for application-scale JavaScript development

#297

Earlier quoted context omitted.

I have a theory about this - how you feel about static typing is related to whether you see the compiler as your friend or as your enemy. If you see the compiler as your friend then you tend to like type checking because it blocks certain bugs and typos. It won't let you run your code until they're fixed. If you see the compiler as your enemy, as a barricade that you need to get past, then you tend to not like static…

> I have a theory about this - how you feel about static typing is related to whether you see the compiler as your friend or as your enemy. An alternative explanation is a dislike of overly verbose languages with terrible type systems (the poster child for this category being Java), and as a result of low exposure to better statically typed languages painting all of the category with a Java brush.

probably true if people equate static typing to Java then they assume it adds a lot of overhead.

Re: TypeScript: a language for application-scale JavaScript development

#298

Earlier quoted context omitted.

I have a theory about this - how you feel about static typing is related to whether you see the compiler as your friend or as your enemy. If you see the compiler as your friend then you tend to like type checking because it blocks certain bugs and typos. It won't let you run your code until they're fixed. If you see the compiler as your enemy, as a barricade that you need to get past, then you tend to not like static…

> I have a theory about this - how you feel about static typing is related to whether you see the compiler as your friend or as your enemy. An alternative explanation is a dislike of overly verbose languages with terrible type systems (the poster child for this category being Java), and as a result of low exposure to better statically typed languages painting all of the category with a Java brush.

probably true if people equate static typing to Java then they assume it adds a lot of overhead.

Re: TypeScript: a language for application-scale JavaScript development

#300

Earlier quoted context omitted.

I don't know, ECMAScript 6 looks a lot like Coffeescript, and ECMAScript 6 modules look a lot like Node modules.

> I don't know, ECMAScript 6 looks a lot like Coffeescript, and ECMAScript 6 modules look a lot like Node modules. The fact that after all this time and efforts, ES6 won't be released for another year plus, speaks volumes about the "design by committee" thing.

Nope, spec finalization follows shipping.

First, Firefox and Chrome (under a flag, to be removed) already ship great pieces of ES6. JSC (Safari) and IE prototypes coming too. This is necessary to test interop and design soundness.

Second, we don't do "Design by Committee", we use the "Champions" model where 1 or 2 people design a proposal and a larger number beat it into consensus shape without "redesign".

Nothing's perfect, least of all with multi-browser standards, but if you have an alternative for evolving the actual JS language implemented by browsers, lay it on us.

Compilers on top are great, and many. Good to see MS do one that tries to build on ES6.

Post reply on HN