Live data from Hacker News

Angular 2: Built on TypeScript

blogs.msdn.com

201–210 of 235 posts

Re: Angular 2: Built on TypeScript

#202

Earlier quoted context omitted.

> Typescript is just ECMAScript 6, with type annotations . Then it's not "just ECMAScript 6", is it? Anyway, I'm not saying TypeScript doesn't have merit--in fact, I'm considering using it in my next web app. I'm just saying that using TypeScript is a tradeoff that's not without drawbacks, since you're now dependent on a new set of tools and new additions to the syntax (which means, for instance, that your editor/IDE…

I don't see what the trade-off is. You can just take the transpiling output and go home if you want. Out of all the languages that transpile to JavaScript, Typescript is probably the least risky because it is just JavaScript if you want it to be just JavaScript.

The tradeoff is having to use a language other than JavaScript, which entails having to use a transpiler in the first place, versus just writing plain old JS.

Re: Angular 2: Built on TypeScript

#203
post #19

Earlier quoted context omitted.

I am pretty sure that TypeScript just adds type safety and is optional. I don't see this as a huge negative and I actually see this as a positive. Just curious, what and why are all your reasons to move away from Angular?

- Not-so-great documentation. - Lengthy learning curve. - Not concerned with performance at all (can be a nightmare on mobile devices with low RAM). - Google's history of throwing away and/or deprecating projects, (see Angular v1). - I still have yet to see a Google website using Angular in any large capacity. - Ecosystem lock-in. It tries to do a LOT of stuff, and you generally need to be doing all these things the…

> Not concerned with performance at all

I would strongly disagree. Watch this link to when Igor talks about Angular performance.

https://www.youtube.com/watch?v=QHulaj5ZxbI&t=35m30s

Re: Angular 2: Built on TypeScript

#204

If Google is promoting TypeScript, can they still promote Dart? How many alt-javascript's can one company promote?

They use it internally, but seriously as a platform for other people to use?

Not really, no.

...then again, the 'dart community' has diminished to basically nothing, so I doubt many will care particularly.

Re: Angular 2: Built on TypeScript

#205
post #179
post #167

Earlier quoted context omitted.

Angular 2 is heavily inspired by AngularDart. Angular 2 has a single codebase for JS and Dart.

Sounds like they are trying to move people from Angular to Dart

The other way around.

(oh! You meant as, in, externally, not internally. I see...)

Re: Angular 2: Built on TypeScript

#206
post #106

Earlier quoted context omitted.

To be fair, JavaScript started out as a language that looks like Java. "JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0" -- http://en.wikipedia.org/wiki/JavaScript#JavaScript_and_Java

That cherry picking you just made just completely reversed what was actually said in that article: "A common misconception is that JavaScript is similar or closely related to Java. It is true that both have a C-like syntax (the C language being their most immediate common ancestor language). They also are both typically sandboxed (when used inside a browser), and JavaScript was designed with Java's syntax and standar…

> A common misconception is that JavaScript is similar or closely related to Java.

He said it looks like Java, I believe. Not "it's similar to Java".

Re: Angular 2: Built on TypeScript

#207

Earlier quoted context omitted.

Completely agree 100%. Hopefully Typescript isn't merging any sort of runtime type checking.

I think angular is not after runtime type checking , like the TypeScript compiler. I think what they're after is keeping type information beyond `instanceof`, like keeping information about interfaces and the ability to access type properties beyond `Foo.prototype.bar`. Edit: to clarify, runtime type information should not be used to check for types again , but rather to do things similar to Java's reflection.

The angular team designed atscript. Have a look at their doc. It does contain runtime type checking and it looks like this:

var length = rtts.type(name.length, rtts.int);

https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0fQ7KSit9...

Re: Angular 2: Built on TypeScript

#208

Earlier quoted context omitted.

I have specifically avoided angular because I feel like it's a monster in that you are so tied to learning and understanding it's proprietary system. I too have moved directly to react. Can anyone comment on how the skills learned by learning Angular can be applied any where else?

You're 100% right. Once you're in Angular-land you are completely tied to the framework. You don't think about "how can I make X in my domain happen?" you think about "how do I make X in Angular happen". This coupled with the horrific Angular docs make it really tough to justify using from a productivity standpoint. I've moved to React as well and feel it's a 10x boost in productivity because I'm constantly thinking…

You can even use react components in angular directives so this is just not true.

Re: Angular 2: Built on TypeScript

#209
post #130

Earlier quoted context omitted.

I disagree. Typescript is just ECMAScript 6, with type annotations. Most of the differences come from the language changes (ES5 -> ES6), than the superset that Typescript explicitly adds.

> Typescript is just ECMAScript 6, with type annotations . Then it's not "just ECMAScript 6", is it? Anyway, I'm not saying TypeScript doesn't have merit--in fact, I'm considering using it in my next web app. I'm just saying that using TypeScript is a tradeoff that's not without drawbacks, since you're now dependent on a new set of tools and new additions to the syntax (which means, for instance, that your editor/IDE…

>Then it's not "just ECMAScript 6", is it?

It's not "Javascript with a bunch of proprietary extensions", either. Type annotations can't be the difference between understanding code in Typescript if you understand Javascript.

You have a point about tooling, but you would have the same problem if you had a project on visual c++ 6 and upgraded to c++/14, and again, you didn't mention it.

All of this is in spite of the fact that ES6 nearly had optional type annotation in the same syntax that Typescript does, along with many other Javascript derivations that use the same type annotation syntax (Actionscript and Atscript that I know of).

Re: Angular 2: Built on TypeScript

#210

Earlier quoted context omitted.

"You have a problem with JavaScript. You rewrite your entire code base in TypeScript. Now you have two problems."

Wrong, JavaScript is valid Typescript, so you don't have to rewrite anything.

No, JavaScript is not valid TypeScript. This might be a silly example but there are dozens of similar, small JavaScript programs that are not legal TypeScript (for good reason!).

http://crystae.net/2015/01/22/typescript-is-not-a-superset-o...

Try running jQuery's source through the TypeScript compiler some time.

Post reply on HN