5 ms·
To me this post boils down to "I already know jQuery, this isn't jQ, so WTF". Well, godspeed, you fancy bastard. I wouldn't use Angular for a small'ih average
by czottmann 13y ago
To me this post boils down to "I already know jQuery, this isn't jQ, so WTF". Well, godspeed, you fancy bastard.
I wouldn't use Angular for a small'ih average website where you want some minor JS-based UI functionality. But I found Angular much more suited than jQuery for big sites that are maintained by more than just one developer. You can look at some piece of HTML and you can tell from the list of directives what's going on. No stray click handlers and whatnot.
One of my more recent clients had used jQuery for ~8 years, the HTML had changed a lot in that time and the JS had grown like a cancer due to developer fluctation and people just adding code to fix their current problems. Quite frankly, it was a mess. I believe that with a framework like Angular it wouldn't have gotten out of hand like this, mostly due to its modular approach to everything.
- iMark 13y ago"But I found Angular much more suited than jQuery for big sites that are maintained by more than just one developer." I think the distinction is more nuanced, Angular isn't intended for producing web sites, so much as web applications.
- RyanZAG 13y ago"I believe that with a framework like Angular it wouldn't have gotten out of hand like this," I disagree completely and in every possible way. This has been the hallmark of every new language/framework/coding philosophy/rant that has ever been made about coding in the last 30 years. And it's always wrong. It's wrong because it doesn't get the real issue: Your code is bad because you have multiple untrained developers just adding code to fix their current problems. It doesn't matter which framework you use - just adding in some code to fix something over a number of years will destroy your code base. It will destroy your jquery codebase, it will destroy your angular codebase, and it will certainly destroy even your ML codebase. I wish the coding community will one day wake up to this fact and realize it's not a technology problem, but I'm pretty sure in 10 years time I will read a post about how you need to switch your horrible old messy AngularJS app to XYZ which will fix all your problems.
- steve_barham 13y ago"I'm pretty sure in 10 years time I will read a post about how you need to switch your horrible old messy AngularJS app to XYZ which will fix all your problems." More likely given the rapidity of churn in the JavaScript world, in about 10 weeks.
- czottmann 13y ago> Your code is bad because you have multiple untrained developers just adding code to fix their current problems Yes, definitely! That is the core problem. My point, the one I obviously failed making, is that it's easier for an untrained dev to just add a line or two to a codebase where everything looks the same due to a lack of clear boundaries (modules, classes, whathaveyou). I had to sift through ~10k lines of JS code that had accumulated over a span of several years. There was no modularity, no real clear-cut structure, which made everything hard to read, so noone really bothered—they just layered crap on top, done. Having a JS thing called `HerpDerpCtrl` where you can tell from searching your HTML whether or not it is still in use would have made the job of cleaning up much easier. That's why I like frameworks, they provide a structure. It won't solve the problem of having bad developers in your team, or a lack of meaningful code reviews, or missing tests, but I believe it'll make it harder for people to screw things up.
- RyanZAG 13y agoAfter seeing this said numerous times about a number of different frameworks, I still disagree. The universe will invent a better idiot and your framework guarantees will make it even more difficult because they will find ways to subvert them and/or add in different modules from other frameworks. So while it might make it harder for people to screw things up at first glance, it will probably mean that when you inherit the code in 10 years time, they've managed to blow AngularJS's whole foot off and you're left trying to reconstruct the whole thing using tweezers. I have only one thing to say to the poor future maintainers of AngularJS apps in the future. Godspeed.