Live data from Hacker News

Angular 2 docs for ES6/7

github.com

51–60 of 62 posts

Re: Angular 2 docs for ES6/7

#51
post #17
post #13

I've been learning AngularJS 2 for around 2 weeks now, and I see why they push use of Typescript. They always have. AngularJS 2 was designed from the start to be typed. To be object-orientated. At the least be object-inspired. It makes sense to be consistent. Using a non-typed and functional-structured language for a typed and object-orientated framework is pretty dumb in my eyes. To digress a little, AngularJS 2 has…

In your logic you equate statically typed and object oriented vs dynamically typed and functional. Object oriented programming is by origin (Smalltalk) dynamically typed. Class based programming languages (which we really shouldnt consider typical for oop) tend to borrow all their modern type features from functional programming languages. (Think polymorphism, generics, interfaces, etc.)

> In your logic you equate statically typed and object oriented vs dynamically typed and functional.

Yes. JavaScript's structure is usually heavily functional and can often be non-modular. Typescript goes away from this somewhat with the construction of objects.

> Object oriented programming is by origin (Smalltalk) dynamically typed.

Really? Object orientation is all about forming your own types, so how could OOP have an origin in dynamic types?

Re: Angular 2 docs for ES6/7

#52
post #17

Earlier quoted context omitted.

In your logic you equate statically typed and object oriented vs dynamically typed and functional. Object oriented programming is by origin (Smalltalk) dynamically typed. Class based programming languages (which we really shouldnt consider typical for oop) tend to borrow all their modern type features from functional programming languages. (Think polymorphism, generics, interfaces, etc.)

By 'dynamically typed and functional' I think he meant javascript. Personally i wouldn't call javascript functional but...

I dunno, i've talked to and seen the code of a few JS devs and they all code very function-based (i.e. little modularity, poorly refactor-able, flow is difficult to understand, )

Maybe that's just anecdotal though, since I know that JS supports some form of OOP.

Re: Angular 2 docs for ES6/7

#53
post #49

Earlier quoted context omitted.

> I think you should allow developers to write using straight-up Javascript. They do, just not ES6. "The examples of the docs are planned to be written in TS, ES5 and Dart". I tend to agree with their argument that if you're using ES6, why not just use TS.

That quote is talking about documentation, not about coding

Which is what this story is about. You're welcome to use ES6 and transpile it. They just don't provide docs.

Re: Angular 2 docs for ES6/7

#54
post #13

I've been learning AngularJS 2 for around 2 weeks now, and I see why they push use of Typescript. They always have. AngularJS 2 was designed from the start to be typed. To be object-orientated. At the least be object-inspired. It makes sense to be consistent. Using a non-typed and functional-structured language for a typed and object-orientated framework is pretty dumb in my eyes. To digress a little, AngularJS 2 has…

Have you tried ui-router for angularjs 2? Just curious. Routing and E2E testing are my biggest concerns for transitioning our 1.x app to Angular2 -- and I haven't had time to really dig into either in detail. https://ui-router.github.io/ng2/

Hmm, no, I haven't. I'm trying to learn the standard routing library for AJS2. It's very bulky and boilerplate-ish which I don't like.

The amount of code and files you need for a very basic login-auth feature for a page is extremely large.

I feel like, after 2 weeks, AJS2 is built for large websites for huge companies, and pointlessly complex and boilerplatey for small websites like a forum, blog, simple store/story site, etc.. I think that if you want to make hundreds of pages, AJS2 or something is your bet, but for a little thing, go with PHP 7.

Re: Angular 2 docs for ES6/7

#55
post #52

Earlier quoted context omitted.

By 'dynamically typed and functional' I think he meant javascript. Personally i wouldn't call javascript functional but...

I dunno, i've talked to and seen the code of a few JS devs and they all code very function-based (i.e. little modularity, poorly refactor-able, flow is difficult to understand, ) Maybe that's just anecdotal though, since I know that JS supports some form of OOP.

Are you confusing functional programming with procedural programming?

Re: Angular 2 docs for ES6/7

#56
To me, many of the comments seem to have it backwards.

ES6 is a superset for ES5, so given the ES5 docs you can write NG2 apps with ES6.

Typescript being a superset of ES6 means it would be a struggle to write an NG2 app in ES5 or ES6 given only the Typescript documentation. I tried during beta, it was an exercise in frustration that I finally abandoned.

Providing documentation for the lowest common denominator of ES5 should let you write in ES6 (heck, it should let you write in Typescript if you realyl wanted to!) But some of the dev's comments are a bit backwards IMO when they say use Typescript documentation for ES6.

You can see my beta NG2+vailla JS project here https://github.com/chad-autry/ng2bp

Re: Angular 2 docs for ES6/7

#57
For those of you who are saying that TypeScript is a superset of ES6. Stop! ES6 does not have decorators. See https://github.com/tc39/proposal-decorators .

Almost all Angular2 projects, that claim to be using ES6, are in fact using ES6 + Babel Legacy Decorator plugin https://github.com/loganfsmyth/babel-plugin-transform-decora... . The legacy plugin adds syntactic sugar on top of ES6. This is no better than TypeScript in the first place.

Re: Angular 2 docs for ES6/7

#58

It's the attitude of the Angular 2 team that makes me glad I decided to choose Aurelia instead. Nobody seems to realise that Angular 2 exists first and foremost to meet the needs of Google's internal Green Tea team and not the public. This is just one of many things that should make people think twice about using Angular 2. The fact the team seemingly take input from a select handful of "Google experts" to guide the…

>Nobody seems to realise that Angular 2 exists first and foremost to meet the needs of Google's internal Green Tea team and not the public. Isn't Google using Dart internally ? From what I've seen all their NG2 projects use the Dart version and their Material design component lib is Dart ? So if what you were saying was true they would dump the TS/JS version and migrate the team to work on the Dart version 100% and n…

Dart team member here. Google is using Dart heavily internally. Many, many significant apps (think Adwords, Adsense, Google Fiber, and a pile more) are shipping on AngularDart 2.0 today.

It's not accurate to say that AngularDart exists first and foremost to meet the needs of one internal team - it exists to provide a great framework for apps of this type (significant, complex web apps).

We think we're making pretty awesome progress here - we've been able to dramatically increase velocity since the source split (a couple of months ago), and have made really large improvements already in application performance and in shrinking the size of the compiled JS for AngularDart apps.

Re: Angular 2 docs for ES6/7

#59
Angular core team member here, let me see if I can clarify some of our decisions here:

It's not a secret that we promote Typescript as the first choice for Angular2 - this is a conscious decision based on both technical reasoning as well as feedback from our developer community.

I can count on one hand the number of teams I've spoken to who really want to use ES6 - the vast majority are happy using Typescript.

Typescript also allows us to do the kind of static analysis we use to do ahead-of-time template compilation, something that is significantly more difficult with ES5/6 - we've discussed making this work in the future, but for now it's a lot of engineering investment for something there just isn't the demand for.

A couple of other things I want to mention - "enterprise" gets thrown around on HN sometimes as a bit of a dirty word. We don't see it like that at all - the vast majority of Angular 1 users are exactly enterprise, and we're solving for the problems that large teams like them run into.

Now we're released and stable, I think it's a reasonable ask to add some specific docs on ES6 usage (or at least where it differs from TS), I'll bring it up at the next docs meeting.

Anecdotally, my experience talking to outside teams tells me that TS is not the complexity problem people have - the vast majority of devs coming from ES5-land have trouble with ES modules and bundling, rather than the specifics of ES/TS itself - this is part of the reason we're working hard on the angular-CLI.

As far as Google/Angular's commitment to the outside world - we have a Developer Relations team (of which I'm at member) - our only job is making non-Google developers successful with Angular. Feel free to reach out to me (@robwormald) or @stephenfluin if you've got questions or concerns. We both come from "enterprise" webdev and a big part of our job is making sure outside developers are represented in eng-team decision making.

Also reach out if this is something you care about deeply and want to contribute to the documentation - we'd love your help and I'll put you in touch with the right people.

Re: Angular 2 docs for ES6/7

#60
post #11

Another sign that it's designed for enterprise Java camp: old Angular was very popular in such shops because of IoC and service factories. Now it requires java-like language on top of javascript, with type system designed primarily for autocomplete in IDE to work (even unlike Java in which type system is primarily intended to make runtime do less computations).

The angular core team from Google even has technical PM that handles business relationships. I've recently been to AngularConnect in London - from what I've gathered their future focus is also very much about ease of use. They try to establish angular-cli as the de facto toolchain by incorporating best practices from the community, similar to ember-cli. There are a lot of nice features with the new compiler infrastru…

ngrx creator (and ng core team member) here - you'd be surprised at the uptake on ngrx/redux in enterprise I think - a lot of the constraints / guarantees redux offers are really attractive to big teams, and pretty much every big enterprise team I've spoken to in the past few months are using or at least investigating using it.
Post reply on HN