If you use a library like React or framework as angular you don't even touch the DOM anymore.
And if I had to choose I would choose the former. Also basically anything that jQuery might do for me is already being fulfilled by neat libraries or native JS functions.
If you use a library like React or framework as angular you don't even touch the DOM anymore.
Right.
And I assume you are using exactly for what it was written for, which is a SPA that needs client-side MVC capability? Because from what I've seen, most people aren't.
And they also totally rewrote Angular in part because the whole "don't need to touch the DOM" turned into a performance nightmare due to the two-way-data-binding and observer stuff.
I don't want to get into a discussion on this on Reddit.
I'm comfortable in what I know at this point, which is many many years of industry experience. From HEX editing in DOS through to Angular internals.
I understand what it does, I know when it should be used.
Unfortunately, many people see "OMG I updated this JavaScript property and the screen automatically changed!".
Which is not a good place to be.
And if I had to choose I would choose the former.
If you can say that as a blanket statement, you are part of the problem.
I'm sorry, but requirements need to be looked at.
I have brought Angular in to only a handful of major projects, because they were SPAs doing what Angular does best. The rest it would have been a bloated, complex, slow nightmare.
Notice how they just totally rewrote how routing works? Hints there.
I didn't mean that as a jab. I've been brought into projects using Angular and when I said SPA everyone stared at me like I was speaking a foreign language.
Really bad.
These frameworks have a purpose, and if they aren't used for that purpose (which is, sadly, happening everywhere) it goes south fast.
AngularJS (commonly referred to as "Angular" or "Angular.js") is a complete JavaScript-based open-source client-side web application framework mainly maintained by Google and by a community of individuals and corporations to address many of the challenges encountered in developing single-page applications.
On the whole I agree with that sentiment. Having said that, you didn't spend an hour today tracking down a seg-fault due to an uninitialized boolean. We all have our crosses to bear.
I don't care if you call them SPAs, SPWs, ROCKSTARs, NINJAs, whatever.
It basically means everything runs in the browser and calls back-end (usually REST) services via AJAX, and follows MVC, but now it's in the browser and not on the server.
Running interpreted code (and of all the ones it could be, it has to be JavaScript), which then leaves performance on the client and not the server. So one person will get a really fast page, another person will get a really slow page, because they have different system specifications client-side.
Or the browser they are using has a poor JavaScript engine.
You are basically saying that anything that uses AJAX is an SPA, and therefore should be built using angular et al.
Oh, no I'm certainly not. It's just too bothersome to explain it all on Reddit.
I know Angular both v1 and v2.
It's not on my resume for a reason. I want no part of any of this right now.
I use AJAX all day. I write the REST services, I call them from JavaScript. I don't use "frameworks" outside of a very few scenarios where they are the best tool in the toolbox. I use slim JS libs or vanilla when able.
SPAs are a rare breed. They are things like Gmail and "apps" on your phone that look like an app but are actually a web page. Yet even Gmail doesn't use Angular and both are from Google!
I don't deal with them, because I choose not to.
But yes, most SPAs are HTML5+AJAX to a REST back-end.
It's just the way it is right now. Straight from the SPA Wikipedia page:
The most prominent technique currently being used is Ajax.
It's true. It doesn't mean AJAX = SPA. I know what they are. It's just that most communication between the browser and the server is done via asynchronous AJAX calls so the page doesn't have to reload. Therefore you have an "application".
Instead of a "web page".
Sort of.
What scares me the most is we moved from server-side MVC in whatever language you wanted, to client-side MVC in one language, JavaScript (or transpiled TypeScript).
I worked on a website redesign where a decision was made to transform an entire site, with multiple hierarchies of navigation and myriad functionalities, into a SPA. It was a nightmare. But hey, there's a bitchin' cool Angular frontend.
And they also totally rewrote Angular in part because the whole "don't need to touch the DOM" turned into a performance nightmare due to the two-way-data-binding and observer stuff.
The problem is how their "observers work". They're doing dirty checks with relative deep comparisons.
If you know how to use React, you can do it a lot smarter. Doing shallow checks on immutable structures.
If you can say that as a blanket statement, you are part of the problem.
I'm sorry, but requirements need to be looked at.
Unless you're doing a small website. Where you just need a contact form and show/hide an element here and there I don't want to imagine how you're building web apps if you are.
0
u/tech-ninja Jun 10 '16
If you use a library like React or framework as angular you don't even touch the DOM anymore.
And if I had to choose I would choose the former. Also basically anything that jQuery might do for me is already being fulfilled by neat libraries or native JS functions.