TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Criticisms of Angular

146 点作者 andreapaiola超过 9 年前

32 条评论

IgorPartola超过 9 年前
Sometimes I feel like I&#x27;m the only one who actually likes Angular. Two way data bindings are very convenient for writing UI. I don&#x27;t want to write an event listener for every onclick, onchange, and onkeypress. I want the values in my models and the values in the DOM to be in sync. I like using nearly straight up HTML as my template. I do this in Django, so why not in Angular? I like that I don&#x27;t need to render things server-side because then the server is just running a REST-ful API. That way I can write different clients for the API and don&#x27;t have to change the server (mobile app, desktop UI, etc.) I like the clean separation between presentation (HTML templates), UI logic (controllers), and communication (services).<p>I feel like Angular&#x27;s biggest problem is the documentation. It starts out talking about things like dependency injection and why that&#x27;s good, instead of simply displaying how to use the framework. It&#x27;s got a steep learning curve and it just seems that people get scared of the documentation and run away before they really give it a try.
评论 #10264903 未加载
评论 #10265025 未加载
评论 #10264874 未加载
评论 #10265802 未加载
评论 #10265168 未加载
评论 #10265853 未加载
评论 #10265297 未加载
评论 #10265054 未加载
评论 #10264964 未加载
评论 #10265871 未加载
评论 #10271060 未加载
评论 #10265880 未加载
评论 #10265404 未加载
评论 #10265049 未加载
评论 #10265170 未加载
SonicSoul超过 9 年前
This is a rehash of the same problems that have been circulating for years [0]. There is literately not a single original thing here. Most of these issues are gotchas that can easily be avoided once the developer is aware of them (such as scope inheritance &#x2F; dynamic scope which is due to Javascript Prototypal Inheritance [1]).<p>What&#x27;s ironic is that angular 2 is fully rewritten in part to fix all of these issues, but none of that is mentioned, and the only focus is on how much Angular 2 sucks because it&#x27;s not compatible with 1. There is also no mention of clear migration path and ability to run angular 1 and 2 side by side [2]<p>I&#x27;ve put 4 Angular sites in production and never faced issues due to any of these problems. I&#x27;ve had issues with caching, end to end testing of ajax calls, sharing functionality with non angular parts of the site. The very fact that the OP listed these issues tells me that he&#x27;s not actually used Angular in production. Angular 1.x has limitations for sure but it works quite well in most scenarios.<p>[0] <a href="http:&#x2F;&#x2F;larseidnes.com&#x2F;2014&#x2F;11&#x2F;05&#x2F;angularjs-the-bad-parts&#x2F;" rel="nofollow">http:&#x2F;&#x2F;larseidnes.com&#x2F;2014&#x2F;11&#x2F;05&#x2F;angularjs-the-bad-parts&#x2F;</a><p>[1] <a href="http:&#x2F;&#x2F;jimhoskins.com&#x2F;2012&#x2F;12&#x2F;14&#x2F;nested-scopes-in-angularjs.html" rel="nofollow">http:&#x2F;&#x2F;jimhoskins.com&#x2F;2012&#x2F;12&#x2F;14&#x2F;nested-scopes-in-angularjs....</a><p>[2] <a href="http:&#x2F;&#x2F;angularjs.blogspot.com&#x2F;2015&#x2F;08&#x2F;angular-1-and-angular-2-coexistence.html" rel="nofollow">http:&#x2F;&#x2F;angularjs.blogspot.com&#x2F;2015&#x2F;08&#x2F;angular-1-and-angular-...</a><p>EDIT: shortened. EDIT2: added conclusion
评论 #10265617 未加载
评论 #10266027 未加载
nateabele超过 9 年前
So, they trot out the same tired arguments against Angular that people have been making since the beginning, and this makes the front page where people engage in serious discussion about it?<p>Did I miss some subtle novelty about this post, or is Angular ennui just that popular on HN?
评论 #10264635 未加载
评论 #10265929 未加载
评论 #10265221 未加载
shubhamjain超过 9 年前
I haven&#x27;t tried Angular yet but have built applications in React. In my opinion, frameworks like Angular suffer from a fundamental problem, that, it is almost impossible to gauge the problems of a new design unless you have a built a medium - large scale application with it which is very hard when you are just experimenting. There might be few heuristics, few rule of thumbs one can follow but still it will be hard to see if the ease - effort ratio will make the framework worthwhile. You can make things too &quot;magical&quot; and also too &quot;worthless&quot;.<p>I guess that&#x27;s why everyone complains that it is easier to build a Todo application in Angular but the troubles grow as you grow bigger. The reason why React is successful might be they did get a chance to experiment the architecture on their own things before releasing it to the public.
评论 #10264710 未加载
评论 #10264538 未加载
nioufe超过 9 年前
While the author makes some fair point about angular&#x27;s weirdness. He fails to understand that many design choices where made because javascript and js libraries were not as advanced as today.<p>For example the module system is made so because at the time, amd, browserify and ES6 modules were not ready.<p>And the main point of angular 2 is not to remake angular because it was weird, it is to adapt it to new technologies.
stupidcar超过 9 年前
When the author doesn&#x27;t understand the difference between a module system and a dependency injection system, it&#x27;s hard to take the rest of what he says seriously.
评论 #10264230 未加载
评论 #10265792 未加载
rbalicki超过 9 年前
Valid criticisms of Angular include that it gives you enough rope to hang yourself, that the documentation&#x2F;tutorials teach you to code Angular in a bad way (abuse the $scope object, etc.) in the interest of making it &quot;easy&quot; and that the terminology and symbols used can be simplified.<p>However, once you learn to avoid Angular&#x27;s pitfalls, it&#x27;s a very powerful tool for creating large apps that do not collapse under their own weight.<p>To illustrate, how often do experienced Angular devs make $scope inheritance errors? If you are, you&#x27;re not using controllerAs syntax and are coding sloppily. No framework can save you from sloppy coding.
评论 #10265480 未加载
评论 #10265165 未加载
Antwan超过 9 年前
&quot;With the next article we’re going to introduce you to React JS, [...] that have won us over entirely.&quot;<p>How can you take the article seriously with that kind of conclusion.
评论 #10264262 未加载
protonfish超过 9 年前
He missed so much. How about non-standard invalid HTML? Breaking all searchability and accessibility? Encouraging voodoo coding?
评论 #10264453 未加载
评论 #10264712 未加载
评论 #10264904 未加载
pwfisher超过 9 年前
Our company had two Angular codebases, the public site and our internal site. Experience in one taught you nothing about the other because there was no &quot;Angular way&quot; to structure your code.<p>Having &quot;enough rope to hang yourself&quot; while our devs were just learning Angular led to an unholy mess. Development slowed to a painful crawl.<p>We hate Angular. We&#x27;re an Ember shop now. We love Ember!<p>Angular gives you enough rope to hang yourself. Ember lets you stand on the shoulders of giants.
评论 #10266004 未加载
neals超过 9 年前
I work as a JS contractor on large custom e-commerce configurators. In the last few months I&#x27;ve learned that Angular is not built for large custom e-commerce configurators. Just my 2c &#x2F;
SFjulie1超过 9 年前
You have the calvinist way of coding: learning, coding, and working harder to improve. Believing that experience will help you build a greater skill. You put your faith in yourself and hard work. You aim for simple elegant code that talks less and does better. You believe more in efficient design than in code: you are a programmer, not a coder.<p>You have the catholic way of coding: believing in a framework like a church and venerating a bloated edifice with multiple weaknesses to support your most complex code.<p>Most of the angular coder I have met are just lazy coders believing in magic and tradition not wishing to see coding has a hard earned skilled acquired by craftsmanship.<p>Coding is not a &quot;tradition&quot;, it is a &quot;Beruf&quot;.<p>I am a protestant programmer, and I believe I will achieve better code with more hard work and learning than by venerating any bloated layers in between that will come in my profound gained understanding of programming.<p>[The one relying on his hard work] is like a man building a house, who dug down deep and laid the foundation on rock. When a flood came, the torrent struck that house but could not shake it, because it was well built. (Luke 6:48)<p>PS: I do angular. I fix my colleagues&#x27; works and it always make me want to puke to dig in this insanity everytime.
choward超过 9 年前
This article is about 2 years late. These are solved problems in angular 2 by default and have solutions in angular 1.<p>= Problem #1: Scope inheritance and dynamic scoping<p>Use directive controllers<p>= Problem #2: Dirty checking<p>Use immutability<p>= Problem #3: Dependency injection<p>I&#x27;m not really sure what the author is saying here. It sounds like he&#x27;s confused and thinks DI and modules solve the same problem. The one statement he has bolded is completely false: &gt; Angular forces you to use a third, custom designed alternative mechanism: one that is inferior to the already existing mechanisms available. You can use a module system if you want. Nothing is stopping you.<p>= Problem #4: Pointless complexity<p>&gt; providers, values, factories, services, constants [...] All five concepts could easily be assigned a single identity. True, so just use providers if that makes you happy. Angular 2 also simplifies things.<p>= Problem #5: Server-side rendering<p>He stated a solution for angular 1. Personally, I don&#x27;t really care about server side rendering so I won&#x27;t elaborate. Angular 2 will have angular-universal<p>= Problem #6: Angular 2<p>&gt; Not convinced yet? Well, what if we were to tell you that the next major version of Angular will take a scorched earth approach to the existing structure that means it will have zero retro-compatibility with what exists today?<p>&gt; it would be simply foolish to use Angular 1.x for new applications.<p>LOL, fear mongering. The angular team has already stated there will be a migration path to angular 2. They also announced they will continue to support angular 1 as long as people are using it. It&#x27;s funny that he complains about angular 2 when it addresses his problems with angular 1.
评论 #10268756 未加载
评论 #10269393 未加载
maaaats超过 9 年前
Funny that the last complaint is that Angular2 will break a lot of stuff, when it will actually fix most of the issues he&#x27;s mentioning above. One can never win.
wmil超过 9 年前
I always feel like scope inheritance problems are overstated.<p>It&#x27;s weird, but it&#x27;s weird in the exact way that JS prototypical inheritance is weird. So it&#x27;s important to learn.<p>Anyways the fix is simple, always initialize your variables before you use them. Either in the controller or using an ng-init.
juristr超过 9 年前
Nowadays: want lots of traffic on your blog -&gt; rant about Angular.<p>The problem is just that you&#x27;re nearly a year too late.<p>- yep angular has flaws (which framework doesn&#x27;t?)<p>- ya, it does dirty checking and yes, that might have perf implications if used the wrong way. But hey, 6 years ago when Angular was created it was a revolutionizing idea, and still holds today. Also, at that time no Objecte.observe existed, nor did SPAs really (well..GWT was kinda the solution at that time). But, did u check what they&#x27;re doing in Angular 2? Heard about RxJS and stuff?<p>- DI: strange syntax techniques to work around minifiers? You don&#x27;t really use those, do u? heard about ngAnnotate?<p>- Oh...AMD, UMD etc...do not dependency injection. And yes, agree, DI together in combination with AMD&#x2F;UMD&#x2F;... creates confusion with newbie frontend developers<p>- Then: Angular 2 is already live on GitHub, for a while; has even it&#x27;s own webpage online<p>- and for god&#x27;s sake..Angular 2 is compatible with Angular 1...read their blog posts, their Tweets, weekly meetup notes and design docs (all openely available on GDocs)<p>- oh..and there are even some rumors server-side rendering will be possible in ng 2<p>I like ur blog, but if you go and rant, please check the latest status, inform yourself, then rant. Nothing against critics, they foster discussion, but only if made properly.
Kiro超过 9 年前
OT: why are they using &quot;BazaarJS&quot; in the titles of both this and the post they&#x27;re linking to but &quot;BazarJS&quot; everywhere else in the articles?
评论 #10264671 未加载
narrator超过 9 年前
They announced recently that there will be an easy Angular 1 to Angular 2 migration path.[1]<p>I think Google is getting blowback from the &quot;worse is better&quot; crowd that have supported the meteroic rise of c, php and mongodb. Specifically, the &quot;worse is better&quot; belief that:<p>&quot;There is a point where less functionality (&#x27;worse&#x27;) is a preferable option (&#x27;better&#x27;) in terms of practicality and usability.&quot; [2]<p>reminds me of his criticism of &quot;excessive&quot; features in Angular, even though those features are there for a reason.<p>Usually, what happens with &quot;worse is better&quot; is that when people start missing key features, a bunch of bolt on pre and post processor tools show up to add features (e.g linters, &quot;strict mode&quot;,Mongo migration tools) that weren&#x27;t needed in the more complete solution.<p>1.<a href="http:&#x2F;&#x2F;news.softpedia.com&#x2F;news&#x2F;google-releases-guide-on-how-to-migrate-from-angularjs-1-x-to-2-x-490106.shtml" rel="nofollow">http:&#x2F;&#x2F;news.softpedia.com&#x2F;news&#x2F;google-releases-guide-on-how-...</a><p>2.<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Worse_is_better" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Worse_is_better</a> [fixed]
评论 #10264472 未加载
aikah超过 9 年前
Say what you will I like Angular 1. And there is a ton of resources and books all over the web to help.There is a solution to everything and it&#x27;s pretty RAD<p>However, I&#x27;m very skeptical about Angular 2. For several reasons. First (I tested it) right now, it is way too complex and unnecessary verbose.<p>They wanted to support future techs like web components, observables (reactive functional programming) which are great, but it&#x27;s not that easy to use.<p>Some people will not like the Rx approach which forces one to rethink the way one codes. There is serious mental gymnastic involved here when one has to think in terms of cold and hot streams, especially when one is used to ng1.<p>Of course, people who love Typescript will enjoy it,and it&#x27;s true it&#x27;s easier to figure out what is what with explicit types, but people who are sticking with ES5 for various reasons will hate all the boilerplate needed to get started.<p>And they went crazy with dependency injection,this time, this is a divisive issue among programmers and while ng1 DI was light weight, ng2 DI is going full Java which Java&#x2F;C# folks will like, but i&#x27;m not so sure about the rest.<p>The biggest question is, how is ng2 relevant compared to React + Flux&#x2F;Relay? since it tries to do the same thing but with more complexity? with that weird template syntax ([attr-read-from]=&quot;variable&quot; , (event)=&quot;handler&quot; ,[(read-write)]=&quot;variable&quot;, *template-directive=&quot;expression&quot; ... )? React has JSX which is a serious advantage.<p>ng2 will be ready in a year at best but businesses can be tempted to just move to React in the meantime and then stick with that.<p>.
评论 #10265090 未加载
fridek超过 9 年前
&quot;I’m not joking: we were perfectly able to get by in one of the Angular projects developed internally — consisting of around 200 Javascript files and a total of around 10,000 lines of code — using only factories.&quot;<p>Funny, I could agree this is true for providers or services. Factories however can&#x27;t be used for singletons, so I&#x27;d rather not know how they implemented shared state and utils.
评论 #10264556 未加载
gizi超过 9 年前
Angular is the answer to another question than the question that I usually face. So, the usability guy and the graphical designers have produced HTML&#x2F;CSS page designs that work well and look good. The purpose of the javascript that I will be adding, is to make sure the user interface functions. Faced with these requirements, I have never been in a situation in which I felt that something like Angular would be able to contribute anything useful. If you drag Angular into the fray, it will be the most important kid in the room that you will need to constantly babysit. Forget about what you want to achieve. Think of Angular first. Everything else is unimportant ...
omouse超过 9 年前
Angular&#x27;s dependency injection system is much much better than dealing with CommonJS&#x2F;AMD in my opinion. I would be okay with ES6 modules too but apparently those aren&#x27;t getting much love yet.<p>The scoping in AngularJS can be a bit of a pain but I mean, if you know it&#x27;s dynamically scoped and you know that the directive (ng-if) is introducing a new scope then it isn&#x27;t the end of the world. Emacs has dynamic binding and it&#x27;s been working on pretty well so far and contributes to extensibility.<p>I wonder how the author would convert Angular to use lexical scoping instead of dynamic scoping; would it even be possible without forcing all directives to have a lot of boiler plate?
a-guest超过 9 年前
Angular may not be perfect, and there are lots of other tools out there, but Angular definitely remains an option to get the job done. And when articles like this pop up, I wonder if we all unconsciously fall into the trap of the &quot;Fallacy of the Perfect Framework&quot; described by Shawn Wildermuth in a recent post. As if moving from one framework to a different one, we will all of the sudden have no more problems and everything will be &quot;perfect&quot;.<p><a href="http:&#x2F;&#x2F;wildermuth.com&#x2F;2015&#x2F;09&#x2F;01&#x2F;Angular_v_React_v_Aurelia_v_et_al" rel="nofollow">http:&#x2F;&#x2F;wildermuth.com&#x2F;2015&#x2F;09&#x2F;01&#x2F;Angular_v_React_v_Aurelia_v...</a>
vikingcaffiene超过 9 年前
&gt; Problem #1: Scope inheritance and dynamic scoping<p>Easily solved by using the controllerAs syntax<p>&gt; Problem #2: Dirty checking<p>One time binding to the rescue here. Been available for a good while now. Dirty checking does suck though but is usually not a deal breaker.<p>&gt; Problem #3: Dependency injection<p>The authors main problem here seems to be with problems minifying the code. All one needs to do is to pass in an annotations array which is an established best practice. So instead of controller(&#x27;ControllerName&#x27;, function($scope, $someService){}) one should use controller(&#x27;ControllerName&#x27;, [&#x27;$scope&#x27;, &#x27;$someService&#x27;, function($scope, $someService){}]) there are other more readable ways to do this such as $inject but I digress.<p>&gt; Problem #4: Pointless complexity<p>This is debatable and more a matter of opinion. I disagree and think the glut of the authors woes come from not taking the time to understand the framework properly. The learning curve is steep yes but I&#x27;ve used a TON of javascript frameworks and Angular consistently comes out the winner long term in maintainability and stability.<p>&gt; Problem #5: Server-side rendering<p>Isomorphic javascript to the rescue here. React does it better in this case but its available if you need it. Angular is a single page web app. If you knew that going in and have a problem with it now... well lets just say that its important to understand the trade offs that come with any technology one chooses to include in their stack.<p>&gt; Problem #6: Angular 2<p>Yes this was a concern, and then the angular team listened to the outcry from the community and now have been developing a migration path for users of the 1x code. They have also dedicated an entire team to continue development on the 1x codebase for as long as it remains popular thats why there are two angular websites.<p>While I admit that angular isn&#x27;t perfect (literally nothing is) nearly all of the authors criticisms are due to lack of following best practices. You can find a pretty good summation here: <a href="https:&#x2F;&#x2F;github.com&#x2F;johnpapa&#x2F;angular-styleguide" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;johnpapa&#x2F;angular-styleguide</a>
weatherlight超过 9 年前
I love Angular but I often find when I look on StackOverflow for a better way to do something that the most upvoted &quot;solution&quot; is often the WRONG way(Abusing watchers, Abusing $scope, etc) to do something and often contradicts what&#x27;s in the Angular docs. I can&#x27;t help but think to myself, &quot;No wonder people hate angular. There&#x27;s so much bad documentation(Official and Unofficial) and hacky solutions out there. No wonder people are having a bad time.&quot;
tkinom超过 9 年前
Is Angular really that popular? From google trend, Jquery is still 3-5 times more popular then Angular, React. What do you guys think?<p><a href="https:&#x2F;&#x2F;www.google.com&#x2F;trends&#x2F;explore#q=jquery%2C%20angularjs%2C%20angular%2C%20react%2C%20reactjs&amp;cmpt=q&amp;tz=Etc%2FGMT%2B7" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;trends&#x2F;explore#q=jquery%2C%20angularj...</a>
评论 #10265636 未加载
评论 #10265637 未加载
spleenteo超过 9 年前
for the record: in the second paragraph we can find this sentence:<p>&gt; we’ve been working with Angular for almost nine months now (the original article in italian is dated February 2015)<p>it means this post is just a translation of something experienced a year ago (Angular 1.1) A half of the comments reply to solutions arrived on 1.4, with hindsight.<p>This delay is definitely not clear, but casts new light on the content.
stuaxo超过 9 年前
This is all true, but it is still one of the best options for making websites, onwards and upwards !
评论 #10264353 未加载
评论 #10264470 未加载
iridium127超过 9 年前
It&#x27;s not worth obfuscating the web for what Angular brings to the table.
ldpg超过 9 年前
The #6 complaint on &quot;server-side rendering&quot; calls the rest of the article into question. This illustrates a fundamental &quot;missing the point&quot; of either Angular or React. Client-side templating is one of the essential ideas.
brightball超过 9 年前
Things like this reaffirm my old guy decision to do as little in the browser as humanly possible.<p>EDIT: Warranted a downvote. Wow.
robotnoises超过 9 年前
I need to get my butt in gear and finish-up my blog on criticisms of criticisms of Angular.