Live data from Hacker News

Angular 2 Release Candidate

github.com

111–120 of 139 posts

Re: Angular 2 Release Candidate

#111

I'm looking forward to trying this out. Having written Ember, Angular, and React apps now, I feel like they are all getting closer, but a lot of rough edges still exist. Ember: interesting framework, but all too often, you would hear a team mate say "wait, why is that working, it shouldn't be?" Mixed with equal parts "logically, that SHOULD work, what am I missing?" React: I love the component focus, and redux is pre…

>the insistence on using JavaScript in lieu of helpful abstractions

I appreciate this. The javascript world already has too many abstractions.

>Angular 1: by far the easiest and most intuitive.

How on earth do you find Angular more intuitive than React?

Angular is a behemoth compared to React. This is like saying Rust is easier and more intuitive than Go.

Angular 2 forced me to switch to React because it made me weary of Angular 3 and the new abstractions that that will bring.

It seems also that a lot more big sites are choosing react over angular and I see a lot more job postings for react devs.

Re: Angular 2 Release Candidate

#112
post #92

Earlier quoted context omitted.

Re: switching to TypeScript, manual rewrite or transpilation? My codebase is CoffeeScript, so I'm also interested to hear if you have any experience with that (with Angular 2).

My advice would be to compile your CoffeeScript to JS, then start from there. That's assuming that CoffeeScript still produces readable, idiomatic JavaScript...? As of TypeScript 1.8(?) you can set an "allowJs: true" flag in tsconfig.json, which tells TypeScript to include JS files in your build. Then you can just manually add type annotations and ES2015/2016 goodness to your code and change the suffix to '.ts' on a…

I'm using ts-loader, have you tried both and found awesome-typescript-loader to be better? I'm trying to decide if I should switch to it..

Re: Angular 2 Release Candidate

#113
post #93
post #7

Earlier quoted context omitted.

As someone that works for a #1 company, I am living that anxiety. We all know it will be inevitable, and we all know it will be hell rewriting it. If it's more than copy-pasta then I doubt it will be received well. And #2 is spot on -- React is eating Angular's lunch. I'd love to use it at work but I can't, and I don't think I'm the only one.

React is not "eating Angular's lunch". The only reason it seems that way is that it is impossible to have a conversation about Angular on the internet without a horde of React zealots turning up and banging on about it. Recommending React to somebody who's considering Angular is like recommending tyres to somebody who's shopping for a car.

React is eating Angulars lunch when you look at the amount of large enterprises that choose react over Angular.

Part of the problem with Angular that no one seems to care about is that Angular 2 was such a big change from Angular 1 it forced companies that depended on Angular 1 to do a complete re-write.

I was an Angular 1 dev and Angular 2 caused me to abandon Angular altogether.

Angular also adds more abstractions on top of JS which is unnecessary and can cause unexpected behavior when transpiled.

Re: Angular 2 Release Candidate

#114
post #5

I realize a lot of companies flocked to Angular and it's used in a lot of places, but from the outside it seems to be fighting on two fronts. 1. Companies currently implementing it not wanting it to change or for there to be a quick and painless migration from 1.x to 2.x. So, less change, more hand-holding. The web changed a lot though, so its change is understandable. 2. Trendsetters and upcoming companies looking f…

React and Angular are two very different experiences. Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise framework feeling - hierarchical DI everywhere, everything out of the box (DI, routing, events, forms, etc.), classes and OO are the foundation, decorators, even "functional" parts adopts RX from .NET. Using Dart gets you even more stuff working "out of the box"…

Note that Typescript with React is totally possible.

Re: Angular 2 Release Candidate

#115

"Having to rewrite for our Angular 1 app for Angular 2". Honestly, there is so little continuity that you have the option of just switching to React. Or perhaps, just maintaining your Angular 1 app - and then assuming the 1.x fork will be carried on for a long time.

> just switching to React.

That's what I did :)

I spent a whole bunch of time learning Angular1, was in a coma for close to a year after a bad accident, wake up and find my projects are all outdated and I have to basically learn a new framework. Decided if I was going to learn a new framework it was going to be something not made by google. React was simple to learn, unlike Angular. Everything you do in angular requires you to learn the "angular way", once you can create components and understand flux react is fairly straight forward and doesn't require you to re-learn web development.

Re: Angular 2 Release Candidate

#116
post #87

Earlier quoted context omitted.

No problem. People like you have to stick with the old stuff because of this mindset. I mean WTF is bugging you? It's just code you have to write in order to get the thing running. You could also complain about the empty object in the angular1 method.

> I mean WTF is bugging you? Not the OP, but having to write four lines of code instead of one does not look that good. Less is more. Code bloat should be called out.

The code blocks written don't tell the whole story - the analog to the .Class is the controller in Angular 1, which one would have to specify a controller name or define it right in the component, therefore giving equivalent lines for the most part.

It sounds like the person is awfully resistant to TypeScript as well, as the syntax for a component in TS is just

    @Component({
    })
    class Foo {
    }

Re: Angular 2 Release Candidate

#117

Earlier quoted context omitted.

We've been slowly migrating https://splice.com from Angular 1 to Angular 2, so far it's been great. We switched to TypeScript, we cleaned up our code organization. We are writing new components in ng2 and migrating old code we we go. The betas have been somewhat painful with bugs and breaking changes, but that's the price to pay. When it comes to performance and consistency, ng2 is a big winner. Why not React you mig…

Re: switching to TypeScript, manual rewrite or transpilation? My codebase is CoffeeScript, so I'm also interested to hear if you have any experience with that (with Angular 2).

Progressive switch, we use TypeScript for new code and everything we touch old code, we try to convert from JS to TS. The tooling is amazing, even the skeptics in the team wouldn't go back to js now. Defining interfaces, using types really reduced the feedback loop and sped up our dev time. The one thing that is wish is that templates could verified by the compiler instead of waiting for runtime (react uses views written in code and therefore you get that for free when using react + TS)

Re: Angular 2 Release Candidate

#118

I'm looking forward to trying this out. Having written Ember, Angular, and React apps now, I feel like they are all getting closer, but a lot of rough edges still exist. Ember: interesting framework, but all too often, you would hear a team mate say "wait, why is that working, it shouldn't be?" Mixed with equal parts "logically, that SHOULD work, what am I missing?" React: I love the component focus, and redux is pre…

> However, the more complex an app, the less Angular 1 serves.

That's not really true.

The problem is that all three frameworks are supposed* to require the same discipline when it comes to managing state, but only React forces that discipline onto the developer.

I'm not saying React is better, but learning from React is important to be able to write maintainable applications in any framework. You don't want to have 30 services, each services managing there own little state in AngularJS for instance. Unfortunately that's usually what happens when an app grows with time.

Angular2 does seem to get rid of the dirty checking, allowing better performances. It also has a good router. But does it really bring something new in terms of view layer and state management, considering the cost ?

I like Angular1, it's one js file you drop in an HTML page, no need for nodejs, NPM, a third party language and what not. And it's mature. It's absolutely unfortunate that Angular2 basically forces developers to use Typescript. That's a huge mistake IMHO.

edited

Re: Angular 2 Release Candidate

#119
post #93

Earlier quoted context omitted.

React is not "eating Angular's lunch". The only reason it seems that way is that it is impossible to have a conversation about Angular on the internet without a horde of React zealots turning up and banging on about it. Recommending React to somebody who's considering Angular is like recommending tyres to somebody who's shopping for a car.

React is eating Angulars lunch when you look at the amount of large enterprises that choose react over Angular. Part of the problem with Angular that no one seems to care about is that Angular 2 was such a big change from Angular 1 it forced companies that depended on Angular 1 to do a complete re-write. I was an Angular 1 dev and Angular 2 caused me to abandon Angular altogether. Angular also adds more abstractions…

Angular is still a lot more prevalent than React in most of the world. A lot of the big companies using React also use Angular - it's not so simple.

Most companies are doing the responsible thing and holding off on worrying about migration until Angular 2 stabilizes more. Even if one wanted to do a complete rewrite due to poor Angular 1 app code, one can then evaluate all options from scratch and choose the best option for their app.

Every library adds abstractions on top of JS - React is no different with your complaint of unexpected behavior.

This reads as an overly emotional post without applying engineering - "this sounds too hard so I'll just run away to another solution" is the vibe I get.

Re: Angular 2 Release Candidate

#120
Isn't it ironic that, as we are moving away from fat servers, we are now writing even fatter clients ( which still need a server since one wants in many case to be able to render pages server side and one has to serve static assets anyway ) .

So what is the concrete difference between an API + a node-js server to serve assets and render templates server-side (so with a lot of business logic) + an angular2 client written in typescript , all this VS something like Rich Faces or Prime Faces in a servlet container ? We just rebuild the exact same thing that is hated by most "modern developers", with worse tooling on top of it. Both solutions need a third party language that is not Javascript, both solutions need a compilation step, and command line tools(or an IDE in the case of Java).

Some will say "Well, now the client and server are independent, and if the server changes, one can keep the fat client". But in practice, which side gets rewritten ? the server or the client with the "framework du jour" ?

Post reply on HN