Live data from Hacker News

2 years with Angular

fse.guru

91–100 of 216 posts

Re: 2 years with Angular

#91
AngularJS owes it success to an easy onboard that allows a user to easily create a gimmicky two-way binding demo. And then the pain begins.

It matters little whether some find it productive, what matters is that the engineering principles it is based upon are fundamentally unsound.

Control and conditionals in attributes are absurd. Especially when they require learning an expression language unique to that framework. Especially when they create side effects. Why should something as simple as a loop or if create a new controller and scope? This is absurd. The expression language is not statically analyzable to boot.

There is no reason for a framework to do anything beyond handling the last mile tranform between view model and DOM. Everything else can be done through JavaScript and modules.

JavaScript is a wonderfully expressive language, reinventing that through some hacked up expression language makes no sense and buys no advantage.

Bindings can be handled through a multitude of great npm modules.

Watch the video of the Google Analytics team explaining the cortitions needed to make AngularJS performant. Watch the videos where the AngularJS 2 team discards nearly everything from 1.3 (and then adds their own comical nonsense).

Declarative DOM manipulation through a virtual DOM is the future - every more than web components will be. Why? Because instead of being another "web framework", is it sound computer science.

Re: 2 years with Angular

#92
post #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 lang…

- Everything you need to know about Angular is explained in ng-book or the like. Trying to learn the framework by reading blog posts isn't going to work. There's just too much to know, and it's impossible to understand what's really going on unless it's presented in a logical and comprehensive way. - Angular isn't designed to render large tables. Go with DataTables for jQuery instead, or if you don't need all the fea…

Anyway, it's extremely easy to get around this, provided you are willing to update the table yourself. You just skip the two-way bindings for each table cell and update the cells for yourself. No big deal. If you try to glue angular and d3js I'd say that this is the common course of action - nobody's going to two-way bind every single property

Re: 2 years with Angular

#93

Earlier quoted context omitted.

You say: > That said I've found Angular to be more than flexible enough to meet the needs of your typical CRUD apps The OP says: > Are there any use cases where Angular shines? > * Building form-based "CRUD apps". So I guess you and the OP pretty much agree.

The author and I don't agree, except that Angular is not suitable for high-performance frontends (like games). The author suggests that Angular is only suitable for prototyping and that simply using the framework is technical debt. I particularly disagree with this statement: "Accept the fact that you will suffer in the future. The lowered expectations will help you stay happy sometimes." It seems like the author is…

It's also one thing you shouldn't do in general. IMHO, adding too many abstractions on top of already abstracted concepts is just asking for a maintenance nightmare once the original team leaves.

(some abstraction is fine, but a metaframework on top of a framework is just going too far.)

Re: 2 years with Angular

#94

I've been using Angular now for a year and half, and a year professionally. The only issues I've run into are pages with large data bindings. I would love if the Angular team could recommend a solution other than "don't do that." That answer is simply unacceptable in my opinion -- their silence on this topic has been very frustrating.

Take a look at step by step example improving angular web app performance: http://bahmutov.calepin.co/improving-angular-web-app-perform... I think any framework or library could suffer from these problems.

Re: 2 years with Angular

#95
post #73

Earlier quoted context omitted.

Angular 2.0 seems to be a long ways off - to the point where the presenters wouldn't show actual code examples in their demos of it at ng-europe. It rather makes me worry it is going to be the Python 3000 release all over again in terms of how much is changing.

> It rather makes me worry it is going to be the Python 3000 release all over again in terms of how much is changing. The underlying technology is changing so fast (ES6, web components, mobile web, etc.) that it's going to make upgrading an obvious choice even if it involves relearning a lot of stuff.

couldn't agree more on the Python example, I think one of the main agendas for the 2.0 release will be to make it more popular on mobile side of things (https://www.airport-parking-shop.co.uk/blog/built-app-2-week... is one such example though not from the core AngularJS team) for which they may have compromised backward compatibility infavour of performance.

and also do you think they'll continue with the 1.x releases? since so many developers have already invested time and effort on their webapps and shifting it to an entirely new framework (read release) is a major cost to pay..

Re: 2 years with Angular

#96
I'm a big angularjs fan butI agree with all the points made by the OP.

I will however stick with angularjs because frankly there is no better alternative.

the selling points for me are:

- Testing:Karma,Protractor,dependency injection are fundamental when working with a team.Everything is so easy to test,so easy to mock.

- Speed:Sorry but there is no other framework that makes front-end dev faster.I can come up with very complex apps within hours,fully tested.

- Resources:20+ books,hundreds of blogs,1000+ directives on the web.

- Easy to integrate with legacy jquery mess:since jQlite is compatible with jQuery,I can just drop a jQuery plugin in a directive observe something with no effort and have it rendered properly.

The main drawbacks:

- Dont expect to understand angular without a serious understanding of javascript.

- Performances: yes there are performance issues,but when they show up,one needs to work on these issues.

- Probably too much hype.

Re: 2 years with Angular

#97
post #86
post #46

You know, I'm just going to say it: Angular is the Rails of Javascript. That probably sounds like a derogation. But behold: I offer nuance! They're both big and powerful, and capable of rewarding dedicated study with enormous power. Thus they develop a devoted following whose members often do things lesser mortals find little short of wizardry. They're also both built to be friendly and welcoming to the newcomer, and…

[deleted]

The comparison between Angular and Rails I base on broader characteristics than those embodied in language or framework features. One of those characteristics, a primary one in fact, is that of convention over configuration; Angular, like Rails, defines specific conventions, which only an expert can safely bypass, and to which non-experts must adhere on pain of having a very bad time.

> there are at least 20 books on angularjs that are easy to read to understand the framework properly

A prototypical example of the sort of wizard comment about which I spoke earlier.

> The big issue[, ]in my opinion[, ]is that one needs to know how [J]avascript works in order to understand how directives work.

True of any framework, though; if you don't understand the language in which it is built, you are certainly going to be at sea in trying to use it. Angular isn't special in this regard.

(Also, some notes on English orthographic conventions, for the benefit of someone who may not yet be familiar with them: First, medial and terminal punctuation, such as commas and periods, is invariably followed by a space, as exemplified in this comment. Second, abbreviations such as "isn't" and "doesn't" take an apostrophe before the final 't'. Hope this helps!)

Re: 2 years with Angular

#98
I find the rise of Angular kind of baffling.

Angular's scope system is exactly analogous to the scope system of a programming language. This is a solved problem! When you make a scope system, make it lexical, and require explicit declaration before use. If you're not making those choices, then at least acknowledge that these are the standard answers, with very clear advantages over other scoping systems, and explain why you are not using these answers. But with angular, we have a dynamic, implicit declaration scoping system. New scopes are introduced somewhat unpredictably, at the discretion of each directive. I thought that introducing dynamic, implicit-declaration, non-block-scoped variables in 2014 was like introducing a new car with a coal-burning engine, but no one even seems to remark on it.

Then there's the dirty-checking loop. After every event there is a digest; every digest runs every watch. To me, just reading this description makes a voice speak up in my head: "Uh-oh! That sounds like O(n^2)!" Now that angular is being widely used, people are noticing that it's slow as shit. But why did the framework get to this level without anyone remarking, "this dirty-checking algorithm is fundamentally, irremediably not scalable"? Do people not have a sense even for the most coarse performance characteristics of algorithms like this? Or do people simply think that nowadays "performance does not matter"?

Angular's "module" system is the strangest of all. It doesn't do namespacing or dependency tracking. What is even the point of it? What thought process led to this useless module system?

It's just strange. Hundreds of years of people's work are spent on something, which the most cursory, CS 101 analysis shows to be seriously flawed. Is analysis simply a lost art in this industry?

Oh well, people are finally realizing Angular has its faults, because they've seen them with their own eyes and now they believe them. It would be nice if we could learn from this, and maybe skip the next boondoggle (web components for instance), but I have no hope for it.

Re: 2 years with Angular

#99
post #69
post #63

Earlier quoted context omitted.

> But React is as much a framework as Angular is. Sure,the difference is React doesnt tell you how to organize your application.AngularJS does,you have to use dependency injection.I like it,some people dont. AngularJS is in no way perfect.But compared to other frameworks,Ember,Backbone,... In my opinion it's better. I personally dont like React because of JSX,I dont want to have to learn a JS superset,and i'll probab…

You can use React without JSX. It is especially easy if you are using CoffeeScript which makes the syntax quite terse. I personally like JSX. It is more of a variant of Javascript that lets us mix HTML into JS seamlessly. It was inspired from XHP ( https://www.facebook.com/notes/facebook-engineering/xhp-a-ne... ), a PHP extension developed and used by Facebook that lets PHP understand XML. I think that the cross-poll…

Sure,but you need to learn JSX to read code exemples around the web.So you cant really use React without knowing JSX.

That's a subtle thing but important enough when you're working on big projects.

Re: 2 years with Angular

#100
I work at Google, and have been using AngularJS in different projects for about three years. The OP raises a couple of good points (in particular his "The Bad Parts" are mostly valid), but I cannot understand some others, nor do I share his take away.

AngularJS is not a silver bullet or panacea. It has bad parts such as the directives API (making it hard to create reusable components), the global namespacing in the injector, and indeed, the number of watch expressions is an issue.

That being said, internally at Google:

- we do have well working, shared, reusable UI components based on directives. So it's quite possible to write usable AngularJS modules.

- There are multiple old (>3 years), large AngularJS apps that do not seem to have major maintenance issues. Maintenance of large code bases (>100k SLOC JS) is always an issue, but if you follow the style guide [0] at least it doesn't seem worse than with other JS frameworks

- Code is minified and compiled, using Closure Compiler's @ngInject and @export annotations as required.

OP's comments mostly sound like they were burned by not following software development best practices (e.g. throw the prototype away, make sure to properly design your domain model, have a qualified tech lead, have qualified engineers).

His "Lessons for framework (and metaframework) developers" seem generally useful, but unrelated to particular AngularJS shortcomings.

[0] http://google-styleguide.googlecode.com/svn/trunk/angularjs-...

Post reply on HN