Live data from Hacker News

2 years with Angular

fse.guru

21–30 of 216 posts

Re: 2 years with Angular

#21
post #6

If Angular is not The Thing (a premise which I have no trouble believing), then what is a Good Thing to perform the task of, for example, consuming Django Rest Framework endpoints and making a frontend of them?

Perhaps also consider whether front-end frameworks are a Good Thing given your requirements?

Many of the largest sites on the internet don't use them in any significant way, and you could just as easily use Django to server HTML/CSS to browsers, as well as a Rest endpoint for mobile apps or other users of your data.

Re: 2 years with Angular

#22
post #6

If Angular is not The Thing (a premise which I have no trouble believing), then what is a Good Thing to perform the task of, for example, consuming Django Rest Framework endpoints and making a frontend of them?

It depends if you actually need one. Do you need a full javascript frontend or can you sprinkle JS on top.

I'm a huge fan of Backbone. Its small enough to learn the in's and outs of it and also allows you to control the structure / design of the application.

This definitely has pro's and con's but for us it means we can swap developers and theres a design pattern thats easy to understand and implement.

We're actually building a pretty large Ember project at the moment (a project management tool called Matterhorn). Its been a great experience and we're planning on using it for all of our client projects going forward.

The learning curve is a little high and the 'plugin' eco-system is lacking to say the least. I actually think this is a good thing though as most people write terrible plugins. Roll your own and own it.

Re: 2 years with Angular

#23
post #11

Earlier quoted context omitted.

My front-end guy is totally sold on react/flux. He came to that decision just after we committed to angular... :(

I was fairly sold on react/flux after trying it because it is very simple and you can build very quickly. I've been trying Mercury.js over the last week as I thought the 'cycle' of flux/react was a bit more than necessary. Your front-end guy might be sold on Mercury next.

I did initially think the cycle of flux was a bit too much, but since having to have actions be created from various sources, etc, I've come to realise that it's actually a really good balance.

Having a glance at Mercury. Looks interesting, but react is working so well for my projects I'd need a damn good reason to give it up.

Re: 2 years with Angular

#24

"And whar are no-no factors for angular? Teams with varying experience. Projects, which are intended to grow. Lack of highly experienced frontend lead developer, who will look through the code all the time." I am greatly interested in learning what is the alternative that would be a 'yes-yes' in these bulletpoints.

I don't really see how any of these are a problem with Angular specifically and not just a general problem with any development.

With any team that has varying experience, the beginner developers are more likely to write bad code regardless of the framework. You need to be careful with any project that is likely to grow.. it's called technical debt. You always want someone experienced with the domain to look through the code.

The solutions include, coding standards, code reviews, pair programming, refactoring, automated tests.. all the usual agile suspects.

Re: 2 years with Angular

#25
I recently wrote about my experience with Angular in a different forum. Sharing it here:

I worked on Angular last year building an app with a few complex views. The initial days were full of glory. Data-binding was new to me, which produced much goodwill towards the framework.

Things started falling apart as I had to inevitably understand the framework in a little more depth. They practically wrote a programming language in the bid to create declarative templates which knows about the Javascript objects they bind to. There is a hand-rolled expression parser (https://github.com/angular/angular.js/blob/v1.2.x/src/ng/par...), new scoping rules to learn, and words like transclusion and isolate scope, and stuff like $compile vs $link.

There is a small cottage industry of blogs explaining how Angular directives work (https://docs.angularjs.org/guide/directive). The unfortunate thing is that all of Angular is built on directives (ng-repeat, ng-model etc.); so till one understands it in depth, we remain ignorant consumers of the API with only a fuzzy idea of the magic beneath, which there is a lot of.

The worst however was when we started running into performance problems trying to render large tables. Angular runs a $digest cycle whenever anything interesting happens (mouse move, window scroll, ..). $digest runs a dirty check over all the data bound to $scope and updates views as necessary. Which means after about 8k-10k bindings, everything starts to crawl to a halt.

There is a definite cap on the number of bindings that you can use with Angular. The ways around it are to do one-time binding (the data won't be updated if it changes after the initial render), infinite scrolling and simply not rendering too much data. The problem is compounded by the fact that bindings are everywhere - even string interpolation like `{{startDate}} - {{endDate}}` produce two bindings.

Bindings are Angular's fundamental abstraction, and having to worry about its use due to performance issues seems quite limiting.

Amidst all this, React feels like a breath of fresh air. I've written a post about what makes it attractive to me here: http://www.jasimabasheer.com/posts/on-react.html.

Compared to Ember, neither Angular nor React dictate as rigorous an organization of files and namespaces (routes, controllers, views), and have little mandatory conventions to follow. But React is as much a framework as Angular is. The event loop is controlled by the framework in the case of both, and they dictate a certain way of writing templates and building view objects. They can however be constrained to parts of the app, and so can play well with both SPA and non-SPA apps. The data models are plain Javascript objects in both (it is not in Ember), which is really nice.

Google recently released a new version of their developer console (https://console.developers.google.com) which is built on Angular. So the company is definitely putting their weight behind the framework. However, Angular 2 is not at all backwards compatible. That was quite unexpected. If I had known this going in, I would have never used it for the project. But it felt like such a good idea at the time...

Re: 2 years with Angular

#26

While most of the arguments presented in this article are somewhat valid but I hope with the release of Angular 2.0 majority of the issues will be addressed (though does it make sense to make such drastic changes in the upcoming is another debate and already taken care of at: https://news.ycombinator.com/item?id=8507632 ) I'm currently working on a comparatively large webapp built in Angular and it was after about 7…

If you were given a chance to choose your stack again, what would you pick now? (Considering all the learning you have gained after going with Angular for your large web-app)

Re: 2 years with Angular

#27
post #4
post #2

I confess I am an Angular fan. But this article is not Angular specific at all, it stays on a very high-level. Replace the word Angular with any other web framework and the article would still make perfect sense. Not that the article does not have some value, just that it has very little to do with its title.

NOTE: Haven't used AngularJS and only scraped the article. But Rails for example, doesn't have a namespace problem, because ruby modules provide a namespace and prevent name clashes easily. That said, I'm not sure Rails and AngularJS are direct competitors as many apps use a combination of both frameworks or more generally Rails + JS-framework.

Rails and Angular are apples and oranges. Angular isn't a full-stack framework, it's a client-side framework that handles data source interfacing and view updating.

Re: 2 years with Angular

#28

"And whar are no-no factors for angular? Teams with varying experience. Projects, which are intended to grow. Lack of highly experienced frontend lead developer, who will look through the code all the time." I am greatly interested in learning what is the alternative that would be a 'yes-yes' in these bulletpoints.

I'm checking the first two boxes with React/Flux. Having an experienced developer is usually a good thing, though.

Re: 2 years with Angular

#29
I've worked on Angular projects of varying sizes -some as large as 30KLOC (products where every page has enough interaction to justify an Angular controller)- and I can never find myself agreeing with these articles.

Have I just drunk too much kool-aid? Or is it possible that with the right team, the right architecture, Angular can actually be a really great framework to use? The common theme for every large Angular project I've worked on is that the teams have leaned towards a more functional design where state is rarely used. This has always seemed to encourage smaller, decoupled modules which don't suffer from many of the problems that the author mentions.

But hey, it's probably the kool-aid.

Re: 2 years with Angular

#30
post #11

Earlier quoted context omitted.

My front-end guy is totally sold on react/flux. He came to that decision just after we committed to angular... :(

I was fairly sold on react/flux after trying it because it is very simple and you can build very quickly. I've been trying Mercury.js over the last week as I thought the 'cycle' of flux/react was a bit more than necessary. Your front-end guy might be sold on Mercury next.

Looks very clean, thanks for bringing this up. It might be a good cultural fit for Clojure devs, which is why I'm going to have a closer look.

To save the next guy some googling:

https://github.com/Raynos/mercury

Post reply on HN