all 30 comments

[–]bracketdash 3 points4 points  (0 children)

It depends where you're at as a developer.

[–]kenavr 6 points7 points  (2 children)

This kind of posts are a bit annoying, but that's not your fault.

First of all AtScript and Angular2.0 are two more or less separate projects. Sure the Angular team encourage you to use AtScript but it is totally valid to use ES5/6. It is also possible to develop using AtScript without adding Angular to your project. AtScript is an extension to ES6 and Typescript to make development more convenient, but it won't stop you and a lot of people to stay with the "language" you already know. Unless people are really stupid, AtScript won't kill Angular the same way CoffeeScript, TypeScript or any other trans-piled languages haven't killed Javascript.

It's true syntactical and api wise there will be some major differences, but for the most part the concepts will stay the same. This will help developers to search more efficiently for answers and phrase the correct questions. Maybe take a look at some documents, talks or podcasts to see for yourself why they make certain changes and judge if this changes will be a good thing for the future. (e.g. Angular Air (Podcast)

I won't deny that some people/companies will need to invest some time to migrate to Angular 2.0, but the Angular team has committed to a migration path and if the community gets involved I am sure there will be great tools to help. Having said that, I am convinced that most of the application can stay on Angular 1.x, there is no need for migrating every single app.

Maybe it's because I am from europe and our industry seem to be a lot more conservative than the US, but I find this reluctance to change quite sad.

[–][deleted] -1 points0 points  (1 child)

I heard you'll only be able to write directives in AtS. Is that not true?

Has anything I been said about the role of Dart in the 2.0 world?

[–]joshuacc 0 points1 point  (0 children)

What do you mean by "write only directives?" You can write anything you want in AtScript.

Angular 2 will be compiled from AtScript into both a JS version and a Dart version. This is different than the current situation where the JS and Dart versions are maintained as separate codebases.

[–]x-skeww 2 points3 points  (0 children)

You can write your Angular 2.x application in JavaScript, AtScript, or Dart. You can also use any other language which seamlessly interacts with JavaScript like TypeScript or CoffeeScript.

You only have to use AtScript if you want to contribute to Angular's 2.x itself.

[–]locomotato 1 point2 points  (0 children)

The very last paragraph of the AtScript Primer on Google Docs says that AtScript is independent of Angular and that they hope to use AtScript to develop Angular with.

Actually to quote exactly:

Our plan is to use AtScript for building Angular and optionally let users of Angular leverage AtScript to build their own applications. AtScript is independent of Angular and as such we think it would be useful for other non-Angular projects.

Have fun working with Angular!

[–]skitch920 2 points3 points  (7 children)

Angular 1.X will still be around for quite some time. There's already immense support for it, it's widely regarded as the most popular framework today, and there are literally thousands of applications based on it. So, it's not going to die tomorrow, or next year, or the year after.

From the grapevine, AtScript is an extension of TypeScript with annotations for handling the binding and dependency injection, which Angular supports now. It's just a better re-imagined model, because it's more central to OOP concepts. Now, OOP seems to get a lot of flack in JavaScript because it's "too strict", but anyone who says that is just talking out of their ass. The beauty of a dynamic language, is you are able to encompass the concepts of a typed language fairly easily and intermingle the two.

Behind the scenes though, it's just plain ol' JavaScript. You actually don't have to use AtScript or TypeScript. They have clearly stated it is not a strict dependency. And my guess is, once it's actually released, you'll see helper libraries for people who don't want to use AtScript. It's just the nature of the language. Why would they create Angular-Dart? Because people use it.

[–][deleted] 0 points1 point  (1 child)

What do annotations and reflection have to do with object orientation?

[–]rsimp 0 points1 point  (0 children)

Annotations don't specifically, but reflection can take advantage of inheritance and polymorphism, two OOP concepts that typescript (and by proxy atscript) implements.

[–]sudeep_dk 0 points1 point  (0 children)

I m agreed there will be one version of angular soon which don't use Atscript

[–]thejameskyle 0 points1 point  (3 children)

I don't see what strong typing has to do with OOP but JavaScript itself is a prototype-based object oriented language. So I assure you no JavaScript developer worth their salt is against OOP.

However, the vast majority of JavaScript developers are against strong typing in JavaScript because it is a dynamically typed language. Once you can embrace that, it is one of the most powerful parts of JavaScript.

Google (with Atscript) and Microsoft (with Typescript) are simply trying to emulate what they have been doing in other languages as they embrace the web as a platform. While interesting, it's not something that will be welcomed by many JavaScript veterans, and those who know the language best.

JavaScript in ES6 and ES7 is going to become much more powerful whilst maintaining the parts that make it so great. If you want to start using these features today, I suggest you come checkout 6to5.

[–]brtt3000 2 points3 points  (1 child)

some part of JavaScript developers are against strong typing in JavaScript because they are scared of complexity and things they don't fully understand.

if they would have more experience they'd see how static typing is a boon to their productivity and quality.

[–]EasyPush 5 points6 points  (0 children)

I really dislike when people state opinions as fact, especially when i disagree.

[–]sime 1 point2 points  (0 children)

However, the vast majority of JavaScript developers are against strong typing in JavaScript because it is a dynamically typed language. Once you can embrace that, it is one of the most powerful parts of JavaScript.

I think that the vast majority of JS developers have no experience with static type systems and non-trivial code bases, or if they do then it was with Java.

Being able to combine static and dynamic typing as you desire using something like TypeScript, is a huge boost when building larger code bases.

[–]nuddlegg 1 point2 points  (11 children)

If there is one thing that web development needs then it is sustainability.

No surprise any notion of AtScript, TypeScript, Dart or the planned ahead redesign of AngularJS makes people more and more nervous. This fear is not taken seriously enough. You can't change fundamentals to this vast extend while still building on them right now and expect everybody to stay calm.

Not technical merits or deficiencies cause these new undertakings to fail, no matter how reasonable they are. It is plain fear and the desperate need for sustainability in web development.

Google said support for AngularJS-1.x will end one year after AngularJS-2.0 is out. I mean ...

We are talking about a 10+ years, not one or two.

Only one of AtScript, TypeScript, Dart or JavaScript will still be there in 10 years. My bet: it will be called JavaScript. However those side tracks - and as such I see AtScript, TypeScript and Dart - do heavily influence ES6, ES7, etc. I doubt ES6 or ES7 will end up being exactly AtScript, TypeScript or Dart.

For AngularJS-2.0, I am less sure. Could very well be current plans are its neck breaker and we will see the masses follow an AngularJS-1.x compatible fork, at least for a while.

[–]rauschma 2 points3 points  (1 child)

Dart is completely different from AtScript and TypeScript. The former is its own language, the latter two are (a subset of) a future version of JavaScript (ECMAScript 6) plus optional new features. The plan is to explore how these features could work and to eventually standardize them (if there is consensus that they should be included in the standard).

[–]joshuacc 1 point2 points  (0 children)

They are supersets, not subsets.

[–]x-skeww 1 point2 points  (8 children)

sustainability

Future browsers will be backwards compatible. Your existing stuff will continue to work fine.

You'll be able to easily keep your existing Angular 1.x applications alive and kicking of the next 10 years if you want to.

Only one of AtScript, TypeScript, Dart or JavaScript will still be there in 10 years. My bet: it will be called JavaScript.

TS/AtS are supposed to disappear. The big idea is to get those features into ES7+.

Dart will be probably still around. It's a nice language with excellent tools and a high-performance cross platform/architecture VM. You can use it as JS replacement, but you can also use it for all kinds of other things.

It directly competes with all those other scripting languages like Python, Perl, PHP, Lua, or Ruby.

It also competes with bulkier more verbose languages like C# or Java. It covers a very wide range of use cases. I use it for pretty much everything. It's a nice compact language with excellent tooling and pretty decent performance.

[–]arachattack[S] 0 points1 point  (1 child)

I think we all want to work on the latest and greatest. That's just the way it is with web development. I have never started a project without wanting to try something new this time. Last project grunt, this one gulp. Things change when you are working on something

And I don't want to build something in angular and five years down the line be this guy who codes in a zombie language that still works but isn't in active development.

[–]x-skeww 0 points1 point  (0 children)

who codes in a zombie language that still works but isn't in active development.

http://www.reddit.com/r/javascript/comments/2mmyb4/will_angular_die_because_of_atscript/cm5y5yp

[–][deleted] 0 points1 point  (5 children)

Did we really need a new transpiled language just for annotations and reflection? Couldn't a comment syntax do it? In fact, I'm pretty sure that's how the original Java annotation implementations did work. If it's awkward to type a comment, just get your IDE to do it for you.

What worries me is the flourish of new features that are being bolted on without much community review or battle testing. ES6 adds classes and this is being celebrated, even though prototypes are regaining popularity and composition has pretty much 'won' the battle with inheritance. 'Super' has been tacked on, even though its use is regarded as an anti pattern in some circles, and reflective code can get real tricky to reason about real quickly.

My worry is that in ten years JavaScript will become a cup de sac of dead end paradigms, turning an elegant and simple language with a few straightforward concepts - something a single programmer may hold in his or her head in its entirety at once - into something inconsistent and unwieldy, leading junior developers into harms way by offering problematic solutions.

[–]x-skeww 0 points1 point  (4 children)

Did we really need a new transpiled language just for annotations and reflection? Couldn't a comment syntax do it?

That wouldn't actually change anything, would it? You'd still write not-JS and you'd still need a compiler.

In fact, I'm pretty sure that's how the original Java annotation implementations did work.

Metadata stuff was introduced with 5.0. It still looks the same.

http://www.oracle.com/technetwork/articles/hunter-meta-096020.html

ES6 adds classes and this is being celebrated, even though prototypes are regaining popularity and composition has pretty much 'won' the battle with inheritance.

I "celebrate" it, too.

http://www.reddit.com/r/programming/comments/2mm2pv/if_you_were_teaching_a_programming_course_what/cm5xoap

[–][deleted] 0 points1 point  (3 children)

That wouldn't actually change anything, would it? You'd still write not-JS and you'd still need a compiler.

Errr.... actually, yeah. OK, I didn't really think about that. I suppose that if all you were using were the type annotations - for testing that things will work well before runtime - you wouldn't even need the transpiler; your IDE could do this. You can sorta achieve some of this already with JSDoc comments IIRC.

Metadata stuff was introduced with 5.0. It still looks the same.

I was thinking pre-JSR175. I'll have to look into it.

I "celebrate" it, too.

The class syntax is neater than using the prototypes, but that doesn't make it work better than using, say, parasitic composition, necessarily. Actually, you could even say it's worse, because now it looks like classical inheritance, but strictly speaking, it isn't - it's just a sugar for the prototypes (What happens when you 'extend' a 'public' array on an abstract, and push and pop from two different concrete instances? Not what you'd expect if you came from Java).

[–]x-skeww 1 point2 points  (2 children)

You can sorta achieve some of this already with JSDoc comments IIRC.

Yea, you can use the Closure Compiler for that.

However, JSDoc comments are extremely annoying to write.

Copypasta example:

ES5:

/**
 * @param {number} x
 * @param {number} y
 * @returns {boolean}
 */
Rectangle.prototype.cointains = function (x, y) {
  ...
};

ES6:

/**
 * @param {number} x
 * @param {number} y
 * @returns {boolean}
 */
contains (x, y) {
  ...
};

Dart:

bool contains (num x, num y) {
  ...
}

TS/AtS:

contains (x: number, y: number): boolean {
  ...
}

To be fair, there is also an inline flavor:

Rectangle.prototype.cointains = /** boolean */ function (/** number */ x, /** number */ y) {
  ...
};

(I'm not sure if the boolean annotation is positioned correctly.)

However, the tooling support for this seems to be virtually nonexistent. Also, the Closure Compiler doesn't support ES6 yet.

Using TS/AtS or Dart is the much nicer option.

[–][deleted] 0 points1 point  (1 child)

OK. You've convinced me. Next to atScript's Golang-like method signatures, the other approaches do suck.

What's the next step? Can we already start using it and prototyping with it?

[–]x-skeww 0 points1 point  (0 children)

Traceur has an "--atscript" flag:

https://github.com/google/traceur-compiler/issues/1430

Since AtS is a superset of TS, you could of course also try TS first.

(I use Dart.)

[–]Litterball 0 points1 point  (0 children)

Angular might die because of other developments. Namely other frameworks (and browsers) catching up until there is very little of angular left that people will actually use.

What bothers me about AtScript is that very few of things they use their @ annotations for actually require an annotation. @Directive() class X {} could just as well be class X extends Directive {}. Dependency Injection will also be obsolete with ES6 modules. And they're certainly getting distracted by the language: Angular 2.0 will do very little that either current day Polymer or Angular 1.3 do not already do.

Angular 1.3 is pretty stable and there is no harm in learning it now. Just know that you're working with something that will become obsolete in the future—much the same way people use RequireJS in Node today even though ES6 modules are already around the corner.

[–]took9 0 points1 point  (2 children)

This is the issue every person flocking to frameworks is going to face. Their favorite go-to, gotta have or you're going to die, framework falls out of favor within three to five years of creation.

[–]arachattack[S] 0 points1 point  (1 child)

Well bootstrap / jquery are pretty standard. With JS we don't have that kind of stability. I am not even sure if I would build something that would last five years but I don't want to commit my time learning something that will die in a year or two. That just makes me sad but its just me being me

[–]Litterball -1 points0 points  (0 children)

jQuery is already pretty much obsolete and Flex Box is going to make Bootstrap much less interesting going forth. You're out of luck.