Live data from Hacker News

Why does Angular.js rock?

angular-tips.com

101–110 of 128 posts

Re: Why does Angular.js rock?

#101
post #64

Earlier quoted context omitted.

I would recommend you to take a deeper look at Ember.js. The article above by Jesus Rodriguez is a good article. It shows how Angular is easy to create _very_ small widgets with. But it doesn't tell you much about how to write a big application. My experience with Ember (we're creating a very large app with around 100 different routes) is extremely good. More functionality != more bulk. All new features we add to the…

Thanks for sharing, it's always useful to hear about real-life usage. One thing I didn't hear much regarding Angular/Ember is testing, can you tell us how you approached it?

I can't speak for OP but if you look through the Balanced Dashboard repo there are some good examples:

    https://github.com/balanced/balanced-dashboard/blob/master/test/integration/guest_user_flow.js
For the most part we use integration testing e.g. We simulate mouse clicks and key presses via jQuery and then assert changes in the page behaviour and calls made to the API (see line #85 in above link).

If you approach it like that, and I assume this would be the same for Angular, there's very little testing that's specific to the framework you're building on top of.

At Balanced, even when running unit tests on models to test features in isolation we're still not touching anything inside Ember, occasionally we may jump into the internals to short cut getting the app to a particular state but 99.9% of the time you don't need to.

Re: Why does Angular.js rock?

#102

So those are some neat features but I guess my overall question with all these client side frameworks is: what problem are they solving? I see like these lists of interesting features but I don't see a coherent message behind "why I need this". Usually I go seeking out a library when it does something that I really don't want to have to do on my own, so what's the thing this is preventing me from having to do?

Here's the brief answer, as I understand it: they're frameworks that provide model-view data binding, ease data/presentational decoupling, and (in some cases) provide single-page app (SPA) infrastructure in the mode of MV*. In short, they're designed to tackle some of the common complexities that arise when writing feature-rich multi-part SPAs. You can do it all on your own, for sure, and I actually think that writin…

That's just more buzzwords though. I mean, why do I even need model view data binding? I'm not saying it's not nice to have, but I've written some pretty complicated applications and I never really found data binding to be some sort of killer feature. It's generally struck me as a great demo feature that in reality I'll pretty much never use.

I guess I'd find these things more convincing if they showed me some sort of problem they're solving by showing how awful it would be without what they're doing -- because without seeing the actual problem they're solving, it kinda strikes me as the work of architecture astronauts. It all sounds great on paper, but when I go to use it I can't imagine even needing most of the features this article describes.

Re: Why does Angular.js rock?

#103

The issue I've consistently had with a lot of the "frameworks" coming out recently, is the lack of subject matter experts. It's like someone throws this stuff together, makes an attempt to sketch out some documentation and then just lets the developers have at it. Most of the developers who make videos or tutorials simply do a few basic ones, and leave the rest up to the community to figure out after that. It would b…

That's one of the reasons I prefer Backbone. It was born out of a business project, still maintained by it's creator, and usage examples and production apps abound: http://backbonejs.org/#examples

Re: Why does Angular.js rock?

#104
post #80
post #41

Earlier quoted context omitted.

Dependency Injection can really be done in a dark magic way (the java / spring way), but after reading the source code, i can tell you angular.js way of doing it is really not that dark. More importantly, is extremely easy to use. No .xml file, no configuration file, just put the service in that function signature, done (unless you want to minifiy, which means you'll also have to add it as a string right next to it).

Well, in my option DI is one of the worst parts of Angular. It's a module system which can't be integrated with anything. Doing something like commonjs/amd would be much nicer: app.controller('Name', function(require) { var $scope = require('$scope'); var y = require('some-service'); }); And suddenly, no problems and no weird syntax!

Require is a service locator, so you are getting some of the inversion of control benefits, but I greatly prefer the injections of the dependencies I need instead of relying on a locator.

In practice the DI approach is very nice, and works consistently. It also makes unit tests more straight forward.

Re: Why does Angular.js rock?

#105
post #4

I am just starting up web development and have decided to use Django for backend. However, this Angular vs Ember comparisons have lowered my confidence as I think whatever choice "I" make, will turn out wrong in the long run. Can the experienced people here tell me what I should choose? I am fine with either style of approach to HTML(template vs declarative) and I just want a batteries included framework, which I can…

I'm a django expert and I've built dozen of projects with it. So it would be hypocrite of me to tell you not to learn it. On the other hand, when I first started learning it, it was a young framework not well known (PHP was still hot.. Rails and Django developers were the hipsters of the web on the edge of technology ;-)

I'm pretty happy about my choice to be on the edge as when it got mainstream, I was already very proficient with it. So, in that sense, I think I'd still suggest you to pick a more edgy framework.. say Node with Angular (or ember).

Re: Why does Angular.js rock?

#106

So those are some neat features but I guess my overall question with all these client side frameworks is: what problem are they solving? I see like these lists of interesting features but I don't see a coherent message behind "why I need this". Usually I go seeking out a library when it does something that I really don't want to have to do on my own, so what's the thing this is preventing me from having to do?

the biggest problem angularjs solves for me is boilerplate code and easier testable code.

Re: Why does Angular.js rock?

#107

Earlier quoted context omitted.

Hm. In my case, I would have had to invent something like ko.observable anyway, so I guess it works for me. Maybe I'll learn better when things get more complicated.

I'm not saying that it's wrong. KO's approach is a defensible architectural alternative. I guess I took an unnecessarily snotty tone in my previous comment. However, KO's design it didn't sit well with how I wanted things to work. Basically I want plain javascript for my own core logic and then to have round-trip binding to the user interface with a minimum of fuss. For simple cases, Angular does that reasonably well…

No offense taken. I did find that my "model" code was basically the same as the viewmodel. I'm not sure how much that matters or how hard it will be to change, hence "maybe I'll learn better".

Re: Why does Angular.js rock?

#108

So those are some neat features but I guess my overall question with all these client side frameworks is: what problem are they solving? I see like these lists of interesting features but I don't see a coherent message behind "why I need this". Usually I go seeking out a library when it does something that I really don't want to have to do on my own, so what's the thing this is preventing me from having to do?

the biggest problem angularjs solves for me is boilerplate code and easier testable code.

boilerplate to do what?

Re: Why does Angular.js rock?

#109
post #86

Earlier quoted context omitted.

I sometimes wonder what the world would look like if somehow it was all hypercards or DCOM or OpenDoc or NeWS or just about anything other than a simple document format painfully hammered into the shape of an applications platform.

It's fun to run the counterfactuals, but ultimately, we go to war with the lousy technology stack we have, not the mediocre one we want. I'm just overjoyed that, thanks to Android and iOS, people are writing native applications again.

There are known IKnowns: there are APIs we know that we know. There are known IUnknowns: that is to say, there are APIs that we now know we don't know. But there are also unknown IUnknowns: there are APIs we do not know we don't know.

Re: Why does Angular.js rock?

#110
post #63

Earlier quoted context omitted.

Don't worry so much about picking the right tools. Just pick something that is popular and start using it. You want something that is popular to start with because a) there will be a large support community and b) there will be more jobs available for someone who knows a popular framework. That second point is most important, because until you start building/working on an in-production project, most of your efforts w…

Thanks for reminding me of the employment aspect! For the popularity, I believe both ember and angular have large communities. I checked the jobs and angular although leading here, is comparable to ember in terms of job opportunities.

If you look at Google trends there is a massive spike in Angular interest: http://www.google.com/trends/explore#q=angularjs%2C%20emberj...

I'm not saying this should play the biggest part in your descision, but it's worth noting. I implemented 2 small apps in both frameworks, giving me a small fixed amount of time for each. I liked both, Angular gave me less head-scratching and out-of-the-box Twitter Bootstrap integration.

Post reply on HN