TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You have ruined JavaScript

459 pointsby PhilipAabout 11 years ago

51 comments

habermanabout 11 years ago
<i>What the actual fuck is this? I read this as &quot;in order to do a hello world, you must first create a hello world service to create the hello world factory to create the hello world sercice so you can print hello world on the screen.&quot;</i><p>Well, you misunderstood, and now you&#x27;re ranting according to your misunderstanding.<p>I&#x27;m not an Angular, expert, but I&#x27;m pretty sure that the situation is this:<p>1. &quot;Hello world&quot; does not require any dependency injection whatsoever. (ie. it does not require services, providers, <i>or</i> factories). Note: if this was not true, I would agree with this rant completely.<p>2. <i>If and when</i> you decide you want dependency injection, if what you want to inject is a simple value, you can just provide it directly, without using a service, provider, or factory.<p>3. <i>If and when</i> you decide that you want to provide a dynamically-generated value, you can specify a function instead which will get called whenever the value is requested. This is called a &quot;factory.&quot;<p>4. <i>If and when</i> you decide that you want your factory to just &quot;new&quot; an object instead of running an arbitrary function to provide the value, you can register that object type as a &quot;service.&quot;<p>5. <i>If and when</i> you decide that you want to configure that object type first, you can register it as a provider.<p>If you want to stay at step 1 forever to keep things simple, groovy.<p>This is a example of success, not failure: you pay for only as much complexity as you actually want to use.
评论 #7634506 未加载
评论 #7634131 未加载
评论 #7637172 未加载
评论 #7635159 未加载
pronabout 11 years ago
Sigh. I can&#x27;t say anything about Angular because I&#x27;ve never used it. But this constant ridicule of &quot;the Enterprise&quot; is getting on my nerves. Obviously, software design patterns change a lot over the years. Old practices are abandoned -- sometimes more slowly than we&#x27;d wish -- and others replace them. But much of this criticism comes from the fact that the critics 1) use technologies that are not mature enough to have growing pains, and 2) don&#x27;t really know how software is made in the real world.<p>RE 1, the factory&#x2F;provider&#x2F;whatever pattern, comes in real handy when 2 years from now, a crucial ODE library that your air-defense system uses, absolutely has to be replaced by something else. And it&#x27;s not like a kid could write a quick re-implementation in Go over the weekend.<p>As for 2, many of these patterns have been designed for software that does not resemble web applications at all. Just to give a sense of how out-of-touch SV developers can be with regards to the software world at large, IBM, Oracle and SAP combined employ more people than Google, Facebook, Twitter and LinkedIn combined, ten times over; there are more Java developers in the world than the <i>entire population</i> of the entire Bay Area.<p>I&#x27;m not saying that the maligned &quot;enterprise&quot; patterns have a place in a client web framework, or that some of them aren&#x27;t dated. All I&#x27;m saying is, stop treating some software patterns that you think are unnecessary just because all you build are CRUD web-apps as inherently stupid. They are not. One of the reasons people working on CRUD web-apps can &quot;move fast and break things&quot;, and just &quot;rewrite the whole thing in a couple of weeks&quot;, and say stuff like &quot;what&#x27;s wrong with a simple &#x27;new&#x27;?&quot; is precisely because the software they develop is, frankly, not that complicated.<p>I would also like to remind the author that his beloved Erlang was developed in the very same environment he thinks so little of.
评论 #7633743 未加载
评论 #7633639 未加载
评论 #7633917 未加载
评论 #7633770 未加载
评论 #7634569 未加载
评论 #7633541 未加载
pilifabout 11 years ago
It&#x27;s the same pattern that repeats itself all over the place. We&#x27;ve seen it with Java, with Ruby, heck, even with PHP. And now with JS: As applications grow, we tend to search for tools to help us cope with the growth.<p>After doing similar (but still slightly different) things over and over, we start building abstractions and with every thing our abstraction can&#x27;t deal with, we make them more complicated.<p>Whether you use the official name of your thing (&quot;factory&quot;) or you just run with your own idea and term - the outcome is always the same.<p>As a library, you feel the need to be abstract enough to cope with every feature request ever asked from your library and there will be tons of feature requests and tons of little parts people want to customize.<p>And honestly, don&#x27;t we all prefer using some public API of a self-contained library to patching said library (think of the maintenance as that library gets updated)?<p>This isn&#x27;t about ruining a language. This is about making the right choice of library or about the decision of building your own little customized thing that exactly fulfills your requirements (and nothing else), but as your requirements change, you&#x27;re going to add abstractions yourself and suddenly you&#x27;re back at the AbstractSingletonProxyFactoryBean, though you might have chosen a different name that nobody but your team understands.<p>As a library author, try to resist the feature creep; try to be opinionated (&quot;I&#x27;m really sorry, but logging isn&#x27;t pluggable. You want to log to your XML based logging server? That&#x27;s fine, but you&#x27;ll have to build your own thing or use a different framework&quot;) then you remain accessible and buzzword-free, even though that might cost you some users in the short term.<p>Language has nothing to do with this.
评论 #7633410 未加载
评论 #7634028 未加载
评论 #7634146 未加载
protonfishabout 11 years ago
It makes me so happy so see some hate for Angular. I decided to specialize in front-end web development a few years ago because the state of back end frameworks was so abominable. I escaped to HTML, JS, and CSS so I could quietly develop in peace. Now we have Angular, Knockout, Bootstrap - please for the love of all that is good, just stop. This nonsense is nothing but mountains of technical debt. When I tell this to framework fanboys, they counter with &quot;But you can get things running so quickly using frameworks.&quot; This is the definition of technical debt (doing things fast now at the expense of doing things slow later) but it is also complete nonsense. I challenge anyone to a contest to create a quick font-end site where you can use as many Rube Goldberg contraptions as you like and I only use jquery. So then when they back down because they know they will lose their excuse is &quot;But Chris, you are just so smart - the average dummy developer can&#x27;t do what you do.&quot; My final rebuttal is &quot;If you agree that I am such a genius, why won&#x27;t you listen to my advice?&quot;
评论 #7633764 未加载
评论 #7633893 未加载
评论 #7633693 未加载
评论 #7633757 未加载
评论 #7633723 未加载
Drakimabout 11 years ago
I keep reaching the conclusion that frameworks are evil and libraries are awesome. Frameworks promise to organize your code and keep things structured, but the inherent verbose nature of JS frameworks ends up harming more than the structure helps.<p>Ultimately, if naked JS is too difficult to manage due to the lack of types and interfaces, I much prefer to use another language that translates to JS, rather than attempting to force it onto the JS language, because it always becomes messy and half-baked.
评论 #7633262 未加载
评论 #7633390 未加载
评论 #7633910 未加载
评论 #7633260 未加载
PhilipAabout 11 years ago
The author might be confused by AngularJS, but all of the projects I have converted from simple JS to Angular have more than halved the amount of code needed, and made the applications much more easy to maintain.
评论 #7633463 未加载
评论 #7633370 未加载
mercurialabout 11 years ago
I can sympathize with the article, but on the other hand, when you reach a certain level of complexity, OO kind of forces you to use dependency injection. Which means providers and factories of some sort for short-lived objects, at least if you want to have testable code. I don&#x27;t know if it&#x27;s &quot;enterprise hand-holding bullshit&quot;, but having seen code with and without DI, the DI one is definitely easier to work with and refactor. This doesn&#x27;t mean Angular is not over-engineered, since I don&#x27;t use it I have no opinion on the matter.
评论 #7633303 未加载
评论 #7633375 未加载
评论 #7633836 未加载
cs702about 11 years ago
This reminded me of &quot;Why I Hate Frameworks,&quot; a great post from 2005 in the Joel on Software forums: <a href="http://discuss.joelonsoftware.com/?joel.3.219431.12" rel="nofollow">http:&#x2F;&#x2F;discuss.joelonsoftware.com&#x2F;?joel.3.219431.12</a> -- my favorite quote from it:<p><i>&quot;I&#x27;ll get around to building [it] one of these days, as soon as I&#x27;ve got my factory factory factory all up and running.&quot;</i><p>Frameworks often <i>are</i> helpful, but as project complexity increases they tend to make it harder to get things done.
评论 #7633838 未加载
fauigerzigerkabout 11 years ago
It&#x27;s even worse. In Java the whole factory&#x2F;provider approach was down to a limitation of the type system. Yes they (we) went completely overboard with it and the ridicule is deserved.<p>But what on earth is the justification for using that pattern in a dynamically typed language that lets you tack anything onto an existing object without controlling its creation?
评论 #7633397 未加载
bitLabout 11 years ago
Is actually anyone considering JavaScript not to be &quot;ruined&quot; by default in the first place?
评论 #7633907 未加载
rafekettabout 11 years ago
I feel like these articles come up every few weeks. people don&#x27;t understand angular (particularly why DI is useful) and criticize it for being verbose or confusing, usually using the provided sample code -- would it hurt to spend some time actually trying to understand the framework than to dismiss it on face because it looks kind of like something people don&#x27;t like in Java?
评论 #7633498 未加载
评论 #7633687 未加载
评论 #7633525 未加载
thrufloabout 11 years ago
I switched to angular explicitly for the dependency injection. Registering a singleton so it can be passed in to other functions and mocked out easily in tests is something I find extremely useful.<p>Whether the framework should provide three different ways to register the object is another matter (a design decision along the harder-to-grok vs accommodate-variety axis) but, frankly, if you don&#x27;t like factories, don&#x27;t use them.
taudeabout 11 years ago
I don&#x27;t really agree with the sentiment. I think JavaScript is being pushed harder and in much larger apps these days, which is why these frameworks and design patterns have cropped up. Try getting a large team, building a large app writing cohesive code without some of these patterns. It&#x27;s true, though, maybe Angular takes it a little too far...but maybe not, I don&#x27;t know, each project is different in size, scope.<p>At first, we rewrote an app using mostly just JQuery, but it quickly turned into spaghetti. Then we added four more devs to the team because it&#x27;s a pretty large project and this is when you need to start reeling in peoples coding style, and applying some design and patterns so that when a new person comes along in 8 months, they aren&#x27;t totaly WTF?<p>The author sounds like he&#x27;s working on a small team (maybe just with himself, since he&#x27;s writing bot the video streaming&#x2F;encoding backend along with the front-end), and therefore his style of coding while effective for a team of one or two, likely won&#x27;t scale up.
skoreabout 11 years ago
I have no idea why the author tries to judge a framework by a stackoverflow post. A lot of the examples are needlessly verbose and some are even wrong, like the &quot;providerprovider&quot; he rightly mocks.<p>Well, how about we look into the actual documentation?<p><a href="https://docs.angularjs.org/guide/providers" rel="nofollow">https:&#x2F;&#x2F;docs.angularjs.org&#x2F;guide&#x2F;providers</a><p>What you find is that you define a provider like so:<p><pre><code> myApp.provider(&#x27;Car&#x27; &#x2F;&#x2F;... </code></pre> and then, if you want to configure it, you inject it with the suffix &#x27;Provider&#x27; into your config function (called when launching the app):<p><pre><code> myApp.config([&quot;CarProvider&quot;, function(CarProvider) { &#x2F;&#x2F;... </code></pre> So - what&#x27;s so ridiculous about that?<p>----<p>Next up he still does not seem to understand the difference between Services, Factories and Providers. That&#x27;s cool and all and might even prompt some to, you know, investigate further and assume that maybe they haven&#x27;t understood it correctly yet before clicking &quot;must blog now&quot; button. He jumps the shark (straight to ridicule) by making up his very own nonsense:<p>&gt; <i>Of course we we can configure providers if we need to configure our applications. How else could we configure our applications and make them configurable for our enterprise scale configurable applications.</i><p>You know, actually the distinction makes perfect sense. A provider is an object that you know you will want to configure globally before it is being used (data source providers, url routers etc.). A service sits on the other end of the spectrum and is being called freshly right when you need it (more in the direction of the pure objects he has in mind). Factories sit in between those two - they cannot be configured ahead of the application, but allow for more internal functionality instead of just returning an object.<p>Having the distinction helps people editing the code figure out what they want to do and others, in turn, to understand what the other programmer was up to. Yes, you can use them somewhat interchangeably, but that&#x27;s life for you: things overlap. How well and strict they are used <i>is up to the programmer</i>.<p>Now, I&#x27;m not bashing plain, custom OOP Javascript - If that&#x27;s your thing, by all means do it, knock yourself out! But what&#x27;s with the hating on people who seem to have a different approach? Wouldn&#x27;t it be healthier to first try to understand where <i>they</i> are coming from? Surely they can&#x27;t all be totally in love with wasting their time on &quot;ruining it&quot;.<p>----<p>In the end what this comes down to is that the author doesn&#x27;t seem to have sufficient experience with the kinds of environments that make the structures in AngularJS not just pleasant, but actually a life saver. That&#x27;s fine - we don&#x27;t need to all have the same perspective. I just don&#x27;t get this style of argumentation that boils down to &quot;don&#x27;t understand, must bash&quot;.<p>He also makes fun (as does one of the SO comments) of this quote from the (old?) angular docs:<p>&gt; <i>An Angular &quot;service&quot; is a singleton object created by a &quot;service factory&quot;. These service factories are functions which, in turn, are created by a &quot;service provider&quot;. &quot;The service providers are constructor functions&quot;. When instantiated they must contain a property called $get, which holds the service factory function.</i><p>You know what? Fuck it. When I tried to understand the Servicy&#x2F;Factory&#x2F;Provider distinction, I stumbled upon the same SO post and you know what ended up being the perfect way of understanding it? Forcing myself to go back to that paragraph right there <i>until I understood it</i>.<p>&gt; <i>No, you are not reading a thesis, you are reading the angular docs apparently. If it were a thesis it would probably be trying to explain a solution to some sort of problem instead of describing a made up solution to a made up problem. (Actually, that&#x27;s not strictly true because academics are in a world of their own too but close enough).</i><p>&gt; <i>It&#x27;s okay, I don&#x27;t really do enterprise any more.</i><p>I&#x27;m as sceptical as the next guy about frameworks, hate &quot;enterprise&quot; with a fiery passion and I escaped academia before it fried my brain.<p>But I don&#x27;t think myself too cool to do my due dilligence before dismissing something that I very obviously don&#x27;t understand yet.
评论 #7633783 未加载
评论 #7633842 未加载
评论 #7633775 未加载
评论 #7634211 未加载
评论 #7634334 未加载
评论 #7635181 未加载
评论 #7634079 未加载
评论 #7634086 未加载
评论 #7634253 未加载
pavlovabout 11 years ago
So much of the bad stuff in enterprise-style web frameworks is basically a software reinvention of classic bureaucracy. Concepts like inversion of control are meaningful, but applied in accreting layers they turn APIs into a re-enactment of Kafka&#x27;s <i>The Castle</i>.<p>The application developer is left holding the receiver of the telephone that supposedly allows him to receive calls from the Castle. If only he can get the right person at the other end of the line, then everything will certainly be sorted out! The Castle is there to serve the developer, so of course there is someone at the Castle who cares: it must be that he just hasn&#x27;t got the word yet...<p><i>&quot;My dear Land Surveyor,&quot; replied the Superintendent, &quot;how on earth should I know all the sons of all the under-castellans?&quot;</i><p><i>&quot;Right,&quot; said K., &quot;then you&#x27;ll just have to take my word that he is one. I had a sharp encounter with this Schwarzer on the very day of my arrival. Afterwards he made a telephone inquiry of an under-castellan called Fritz and received the information that I was engaged as Land Surveyor. How do you explain that, Superintendent?&quot;</i><p><i>&quot;Very simply,&quot; replied the Superintendent. &quot;You haven&#x27;t once up till now come into real contact with our authorities. All those contacts of yours have been illusory, but owing to your ignorance of the circumstances you take them to be real. And as for the telephone. As you see, in my place, though I&#x27;ve certainly enough to do with the authorities, there&#x27;s no telephone. In inns and suchlike places it may be of real use, as much use say as a penny in-the-slot musical instrument, but it&#x27;s nothing more than that. Have you ever telephoned here? Yes? Well, then perhaps you&#x27;ll understand what I say. In the Castle the telephone works beautifully of course, I&#x27;ve been told it&#x27;s going there all the time, that naturally speeds up the work a great deal. We can hear this continual telephoning in our telephones down here as a humming and singing, you must have heard it too. Now this humming and singing transmitted by our telephones is the only real and reliable thing you&#x27;ll hear, everything else is deceptive. There&#x27;s no fixed connexion with the Castle, no central exchange transmits our calls further. When anybody calls up the Castle from here the instruments in all the subordinate departments ring, or rather they would all ring if practically all the departments -1 know it for a certainty - didn&#x27;t leave their receivers off. Now and then, however, a fatigued official may feel the need of a little distraction, especially in the evenings and at night and may hang the receiver on. Then we get an answer, but an answer of course that&#x27;s merely a practical joke. And that&#x27;s very understandable too. For who would take the responsibility of interrupting, in the middle of the night, the extremely important work up there that goes on furiously the whole time, with a message about his own little private troubles? I can&#x27;t comprehend how even a stranger can imagine that when he calls up Sordini, for example, it&#x27;s really Sordini that answers. Far more probably it&#x27;s a little copying clerk from an entirely different department. On the other hand, it may certainly happen once in a blue moon that when one calls up the little copying clerk Sordini will answer himself. Then finally the best thing is to fly from the telephone before the first sound comes through.&quot;</i>
评论 #7633616 未加载
denibertovicabout 11 years ago
This article really hits the nail on the head. In the comments, many people confuse layers of indirection with dependency injection. Those are 2 separate things, you can have dependency injection and not have 100 layers of indirection that confuse the hell out of people.<p>And while we&#x27;re at it. Why the is there a term &quot;Dependecy injection&quot;... it&#x27;s freaking argument passing to functions, and it&#x27;s been around a really really long time. I&#x27;d expect this kind of crap from the JVM and other OO only worlds, but JS is more functional then it is OO, you have higher order functions...why the hell would you want to think in OO terms?
juliusabout 11 years ago
For me, the most helpful feature of AngularJS is the separation of DOM and data.<p>If you just want to use that feature, but you do not want all the framework stuff, you actually can. Here is my way of doing it: <a href="https://github.com/julius/AngularLite" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;julius&#x2F;AngularLite</a><p>Disclaimer: I actually like the framework stuff. I just made this to use it in an existing project (which is too big for a total conversion into the framework structure).
antocvabout 11 years ago
For all the negative comments about FactoryProviderBeanCreator whatever style of enterprise-programming: There is a point to it all.<p>The point is software exists mostly within its socio-economic context - software is mostly made for people by people and will be used by people.<p>The SingletonProxyFactoryBean enterprise-programming tries to solve people-problems, it tries to waddle through dependencies between libraries, frameworks, language specifications, implementations, organizational structure and various teams within an organization.<p>This angular.js enterprisy-feel tries to do the same - push responsibility onto the others, or separate responsibility down (separation of concerns) where nobody actually has to do anything but &quot;configure&quot;. Or &quot;run&quot; it. Or just &quot;buy&quot; it.<p>Thats the ultimate goal of enterprise and this style of programming - which eventually leads to somebody being required to know a language on top of a language on top of a language to adapt it to the business needs.<p>Its the same reason why abominations such as SAP and Microsoft Dynamics (or basically any closed source very expensive suite of software) exist - those products are on the altar of Enterprise, they fit well to the organization and culture of capitalism. They fulfill the goal of &quot;just buy it&quot; or &quot;just install it&quot; and it will do _everything_ a manager or team thinks of. So the programmers make it so - sure the program doesnt actually do anything without the correct set of configurations and options, but now its not an application thats developed inhouse, its a product we buy and can get support for, kind of.
评论 #7633447 未加载
评论 #7633588 未加载
brudgersabout 11 years ago
Screw the technical merits of arguments for and against frameworks in general or Angular.js in particular - that&#x27;s not really the point. By internet standards, it&#x27;s a great article because it has an interesting topic, personal narrative, a strong opinion, a bit of humour, consistent tone, and a reasonable style. In the tradition of wistful paeans - the author is longing for a more wholesome past when JavaScripts roamed unfettered by barbed wire across a pastoral landscape of virgin DOM&#x27;s [yes, intentional] and free of proletarian factory classes.<p>It&#x27;s entertainment not evangelism. Nobody whose work-a-day problems are soothed by Angular will go native because of it. It&#x27;s sermon about &#x27;those people&#x27; and the choir&#x27;s Schadenfreude...and then once the act writing this comment hit &#x27;Schadenfreude&#x27;, I had to ask myself is it a good article by HN standards?<p>Empirically, probably yes. Theoretically no. The problem with Schadenfreude is that it comes at the price of another&#x27;s misfortune, and that is a route to the meanness that both entertains the internet and harms StackOverflow. Telling people that you are laughing at them is the hell of junior high bullying - it&#x27;s just that cool kids get paid to do Erlang and the kids in Toughskin dungarees are getting mocked for using JavaScript boiler plate.<p>It dawned on me that the best HN articles are written in the spirit of mudita - finding joy in the good fortune of others, not their misery unless our humor is black and shares their burden.<p><a href="http://www.paulgraham.com/hackernews.html" rel="nofollow">http:&#x2F;&#x2F;www.paulgraham.com&#x2F;hackernews.html</a>
zoomerangabout 11 years ago
Another case of &quot;I don&#x27;t understand something so I&#x27;m going to just say it&#x27;s too complex and stupid&quot;. The author completely misses the point of service injection in Angular, and then goes on to offer a simpler &quot;solution&quot; that doesn&#x27;t even remotely do what service injection is trying to do.<p>Here&#x27;s the thing - Inversion of Control exists for a reason. Once your codebase gets to a certain size it becomes far, far more manageable to work with loosely coupled components that have no direct knowledge of each other.<p>These abstractions are a <i>good</i> thing. Lord knows how many projects I&#x27;ve had to fix because some idiot decided that &quot;Architecture&quot; was just some silly crusty of enterprise thing, and &quot;Frameworks&quot; are too opinionated - so instead they decide to ignore 50 years of industry conventions and write a spaghetti code pile of shit (But at least there are no factories!)<p>Whether you&#x27;re using procedural, functional, or object-orientated style - A large codebase is still going to be unmaintainable if you don&#x27;t understand how to write loosely coupled components. (More specifically, don&#x27;t write a large program - write lots of small ones and compose them together).
评论 #7634000 未加载
mmaldackerabout 11 years ago
This is just the same rant as the classic &quot;Why I hate frameworks&quot; <a href="http://discuss.joelonsoftware.com/?joel.3.219431.12" rel="nofollow">http:&#x2F;&#x2F;discuss.joelonsoftware.com&#x2F;?joel.3.219431.12</a><p>but applied to Javascript instead of Java.
marknutterabout 11 years ago
I wish a more thoughtful criticism of angular without all the vitriol was getting up-voted to the top of HN rather than this drive-by blog post. It&#x27;s clear that anti-framework people are up-voting to validate their own world views.
boobsbrabout 11 years ago
This type of writing is getting really tiresome.<p>&quot;Enterprise sucks, frameworks suck, X language sucks...&quot; You don&#x27;t like, but other people like it, get over it. Just don&#x27;t use them and stop complaining all the time.
评论 #7633412 未加载
评论 #7633351 未加载
评论 #7633407 未加载
sesabout 11 years ago
This indictment of angular and &#x27;enterprise&#x27; frameworks is pretty one-sided and self-righteous. I hate the bureaucratic and restrictive nature of some frameworks too, but you can&#x27;t dismiss the entirety of them and the problems some of them solve because of it. It&#x27;s very easy to criticise without suggesting or showing any better alternative. For example... if you are a software manager with the &#x27;power&#x27; to choose an entire stack for a new product, what would be your choice and how would you justify it on criteria such as: availability of documentation, developer skillset, testing, security, performance, platform compatibility, time to market etc?<p>Unfortunately all this type of &#x27;boring&#x27; shit that enterprises deal with, they have to deal with for a reason. If you don&#x27;t like that then you have a problem with the structure of the economy, larger businesses, and their politics as well as the technology.
jebblueabout 11 years ago
Good article, I do a lot of Java coding that isn&#x27;t complex at all, the stuff he shows in the article looks like the EJB people got hold of JavaScript and went wild. That&#x27;s sad because I&#x27;m getting back into the front-end more and finding jQuery has stood the test of time and is actually fun to use.
swalshabout 11 years ago
I loved Angular when i first stumbled on it. Binding was cool... the rest of it, i&#x27;d throw away and be really happy.
评论 #7634467 未加载
评论 #7633486 未加载
评论 #7634906 未加载
Cthulhu_about 11 years ago
I think the OP and some of the people in the comments thread just don&#x27;t have the kind of experience needed to realise why Angular is the way it is. The OP does not seem to be a JS developer, definitely not with experience in larger applications or in larger &#x2F; multiple teams working on the same codebase. Checking his profile, all I&#x27;m seeing is short weekend projects and a small (code size based) library; definitely not the kind of thing where using AngularJS would help out with.<p>Just saying; if your only experience is small solo projects (instead of &gt;10K loc, team-based projects etc), then yes, AngularJS will quickly smell of enterprise and eww, especially if based on just that one SO post from a long time ago.<p>If however you&#x27;ve trudged through unmaintainable jQuery code, wrote &gt;30K multi-team BackboneJS applications, etc, then angular is a relief. It allows you to stick to patterns, to isolate your logic, to not have an excuse to not write unit tests anymore, and to actually write an application instead of struggle with your framework or how your views get rendered and when.
ColdHawaiianabout 11 years ago
&gt; Start thinking for yourselves, ditch this shit before it’s too late and learn how to write some actual fucking code. The information is out there, you can do it. If you need handholding with factories and providers and service provider factories then consider that the world doesn’t need your bullshit code and go and get a job you’re actually good at. Stop ruining it for the rest of us.<p>It&#x27;s unfortunate that this post was written in a provocative manner with a very inflammatory tone, because once you look past its rant-y nature, I think it raises an interesting argument.<p>From what I could tell, the gist of the post seems to be that instead of relying on someone else&#x27;s pre-made, out-of-the-box general framework solution (which you have to heavily configure to your specific needs, and is so complicated that you end up needing to hire highly trained consultants), you can create simpler, more elegant solutions simply by writing them yourself from scratch.<p>I&#x27;m not going to agree nor disagree with that argument, I&#x27;m only trying to state what I think the gist of it is.
epayneabout 11 years ago
Thank you Rob. Although there are perhaps some things to nit-pick about your post, I think you have expressed something important about recent changes (last 5 years) to attitudes in the JS community.
rquantzabout 11 years ago
This is silly. It basically amounts to &quot;waaaah I don&#x27;t know angular!&quot; because they saw funny words I a stack overflow example.<p>Factories etc., in angular are not the same as the Java equivalents. And you&#x27;re usually not going to be using providerProviders in your application code, that stuff goes in libraries that, yes, need to be configurable.<p>Angular is a boon for writing testable, changeable javascript apps. Just because one of the features happens to use words you don&#x27;t like in java doesn&#x27;t mean JavaScript is ruined.
评论 #7633759 未加载
joekrillabout 11 years ago
This is just plain absurd. We are not in a one-size-fits-all industry. Far from it. Just because you don&#x27;t quite understand the benefit of a very specific framework (that, incidentally, you know virtually nothing about) does NOT mean it is not useful, or that it has &quot;ruined&quot; anything. We pick the best tools for the job. In some cases that actually IS Angular. In many cases, it is not. But to make broad generalizations like this does nothing but show a lack of understanding.
ulisesrmzrocheabout 11 years ago
When was the last time ya&#x27;ll went &#x27;hell yeah&#x27; when you saw the team you joined was a) was not using a framework or b) built their own?<p>You&#x27;re just begging to be swirlied, my dudes.
sklivvz1971about 11 years ago
It&#x27;s not the language, it&#x27;s the people... Most developers are... not very good. It&#x27;s a fact of life. Abstractions are a phase in learning how to code: I am not surprised that people reinvent the wheel in [insert-currently-trendy-platform].<p>I am surprised that people think that a LANGUAGE can make any difference. Languages are tools, stop pretending they make any difference and fix the people :-)
评论 #7633841 未加载
facorreiaabout 11 years ago
For the application I&#x27;m developing I&#x27;ve decided to keep it simple. Instead of relying on a complex framework with a lot of abstract concepts and layers, I&#x27;m using jQuery Mobile, Riot.js events and Handlebars templates. The actual application code is plain old JavaScript and I can actually understand what&#x27;s going on at any given time.
colemorrisonabout 11 years ago
Angular can be confusing, but the speed of development you can achieve with it has helped give me back many hours of my life.
评论 #7634046 未加载
nakovetabout 11 years ago
This post just remembered me of this question: <a href="http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;245062&#x2F;whats-the-differen...</a>
taudeabout 11 years ago
The OP got a two-fer: mixing the arguments for&#x2F;against Angular and the arguments for&#x2F;against JavaScript frameworks in general. I think they are separate conversations, which is evident below (or above) depending on which threads your read.
Zelphyrabout 11 years ago
Came here expecting to be annoyed at yet another post suggesting we use yet another framework. Pleased to see to see a reasonably cogent (if not a little overly antagonistic) example of why all these frameworks are crap.
outside1234about 11 years ago
One word: Ember.js<p>I can&#x27;t for the life of me understand the popularity of Angular.js.
CmonDevabout 11 years ago
It&#x27;s like a decorative tuning of a broken car. But it was already broken to begin with. The problem is that everyone is too familiar with how to drive that specific brand of broken cars.
评论 #7633232 未加载
KhalPandaabout 11 years ago
Sorry, you only get 9&#x2F;10 from me, not enough swearing.
kuchaguangjieabout 11 years ago
Jquery &amp; extjs is just enough, things like Angular are too complex and abstract, make programming no fun any more.
inglorabout 11 years ago
What&#x27;s the fuss? JavaScript attracts people who complain about solutions to problems they don&#x27;t understand
weavieabout 11 years ago
Factories are singletons. Services are not. Providers let you configure stuff before they are invoked.
评论 #7633976 未加载
jimejimabout 11 years ago
Can we all just agree that premature patterns is similar to premature optimization and move on?
ilakshabout 11 years ago
If you think AngularJS is too complicated, I agree. Check out Polymer and web components.
justinhjabout 11 years ago
This web page is one of those that is just unreadable on mobile.
flyworldhanabout 11 years ago
I totally understand the point. You only need to do is choose the right &#x27;framework&#x27; for your work. Dont make it angryler.js
ff_about 11 years ago
The only thing I&#x27;m able to say after this piece is: &quot;WOW.&quot;
michaelochurchabout 11 years ago
I&#x27;ve come to the conclusion that this non-programming programmer &quot;design pattern&quot; fad is a way of obfuscating mathematical and computational concepts while making them no less hard (as we see by them often being poorly used) but seem less hard (and, paradoxically, more intelligent due to buzzword compliance) to the businessmen who, because of programmers&#x27; weak professional identity, call the shots.<p>Curried function? Too mathematical. Let&#x27;s call it a <i>Factory</i>.<p>Tree-walking algorithm? Let&#x27;s call it a <i>Visitor</i>.<p>Sinusoidal curve? Again, too mathy. Let&#x27;s call it the <i>Vibrator</i> pattern.<p>Lots of words get spilled, mediocre employees remain employed, good people leave or get fired while trying to fight the current of stupidity, and nothing gets done. Brilliant! Now, you can go a step further by creating a system to monitor those mediocre employees, making them basically employable while bringing down the top, and call it &quot;Agile&quot; when it&#x27;s the exact opposite of agility.
评论 #7633585 未加载
评论 #7633522 未加载
评论 #7633423 未加载
评论 #7633348 未加载
评论 #7633575 未加载
评论 #7633308 未加载
guard-of-terraabout 11 years ago
I still write inline javascript blocks in my internal &#x2F;admin service. Who wants to touch me?