Earlier quoted context omitted.
> 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 { }
Angular 2 Release Candidate
121–130 of 139 posts
Re: Angular 2 Release Candidate
#122Isn'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 writ…
Re: Angular 2 Release Candidate
#123Earlier quoted context omitted.
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.
React is a mishmash of various approaches and tools - functional, OO, embeded markup, etc. You can get type definitions for it but it's not really "natural", for eg. support libraries just have terrible type definitions because they don't map to typescript type system nicely at all - which is what I was getting at.
Re: Angular 2 Release Candidate
#124Earlier 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…
Re: Angular 2 Release Candidate
#125Earlier quoted context omitted.
That seems a lot for: Hello world hello child (yes, I know it's not the same under the covers - take it as a comment on the ecosystem, not on the implementation (although it can be a comment on dead code detection too))
I see a lot of complaints about toy app size/complexity. There's definitely a judgement call to makes about app complexity when someone starts a project with a framework. I inevitably find that development in the middle/end of the project is substantially easier when using a good setup like React/Redux/etc or Angular, and changes are easier to make, whereas vanilla development is (relatively) substantially easier at…
Granted, React is pretty big too, but other frameworks, like Riot.js, have shown that they can be much smaller. Then there's Polymer which gets smaller as web components roll out.
In the competition again native apps, web apps have to load really, really fast. Their ability to run without installation is an advantage that needs to be maximized, an on potentially slow and high-latency mobile networks.
Re: Angular 2 Release Candidate
#126Earlier quoted context omitted.
> 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 { }
That are the most reasonable. Actually there are some others which has more something todo with our internal things and that ScalaJS Scala is so good at the current stage.
Re: Angular 2 Release Candidate
#127Earlier quoted context omitted.
I think a lot is preference. I think HTML in JS is dirty just like HTML in server side strings. Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. There is truth to both. Angular gives a lot of flexibility in code style and structure. You can componetize everything and have all your component files in one folder. You c…
> Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application. Javascript syntax allows far more control over the hierarchy. Your example is akin to saying putting a tank in an airplane is the same…
I agree with you on the control but my point was that a lot of people that dislike Angular don't like the idea of putting tags on HTML elements which is very reminiscent to inline onclicks and the hackish approach to apps from yesteryear.
onclick="doSomething()" versus ng-click="controller.doSomething()"
Sure, there's a lot more under the hood with Angular but it looks and feels similarly and it scares some people away toward other approaches.
JS used to have a lot of inline code back in the day. Then jQuery came along and devs moved their JS into separate files but everything was still tied to elements and very frail. It was terrible for apps of any complexity. Now we have a ton of options and there is no consensus. However, maintainability is easier and building robust front-ends that don't break when someone moves a div or renames a class is not difficult anymore.
Angular is my favorite but I'm also liking what I'm seeing from Vue for a lot of applications.
Re: Angular 2 Release Candidate
#128"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 requi…
Yes - you also make a great point about React, and switching to React.
We are talking about JavaScript frameworks, the keyword being JavaScript.
It is not as much of a sunk cost to switch to React because it is very JavaScript compared to Angular. Given that your team already knows JavaScript (probably, maybe, hehe) - they can pick up React fast.
And now looking at Angular 2, where people are suggesting writing Dart or TypeScript over ES6 - this seems like yet another unique Angular learning curve.
Re: Angular 2 Release Candidate
#129I 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…
I knew it before opening the threat. What would the highest ranking post be, someone discussing the merits of Angular 2 or someone doing the usual "yeah nice, BUT REACT!"? There are lots and lots of shops that - for one reason or another - don't care about React. And frankly for someone who works with Angular 1.x, React might just not be that interesting.
I think angular2 is a lot more interesting than angular 1.x and has a lot of merit, especially for a company wanting a "batteries included" framework, opinionated syntax or Typescript throughout. A lot of developers seem to hear angular and still think inefficient 2-way binding or 'enterprise-y' when that's not the case. The roll-out took awhile, bad timing happened, and there was initial confusion over migration. In the meantime 'some' developers found the next shiny thing without considering angular2 anymore.
They're obviously very different approaches and ecosystems so an AB comparison doesn't do it justice and the comment section of HN isn't a good place for that. I'm just commenting on the developer smell around the framework as I smell it today. Sorry if I came off as 'that guy'.
Re: Angular 2 Release Candidate
#130Earlier quoted context omitted.
I think a lot is preference. I think HTML in JS is dirty just like HTML in server side strings. Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. There is truth to both. Angular gives a lot of flexibility in code style and structure. You can componetize everything and have all your component files in one folder. You c…
> Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application. Javascript syntax allows far more control over the hierarchy. Your example is akin to saying putting a tank in an airplane is the same…
We can point our UX designer at this separate file and he can understand it, which would not be the case if it's buried in JS?