Live data from Hacker News

Stepping Backwards from AngularJS to JQuery – An Experiment

hundredminutehack.blogspot.com

41–50 of 68 posts

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#41

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

Personally I welcome useful mentions of relevant alternatives in HN discussions, even if it's someone's own project. I would encourage you to tone down your rhetoric a bit, though. Intercooler looks like a good lightweight tool for projects with lightweight requirements, but based on your own documentation, the claim that it covers most of what is needed for most modern web apps just hurts your credibility.

Carson is in a bit of a bind in terms of marketing Intercooler. There is a huge mass of community support for frameworks that he feels are taking fundamentally the wrong approach. If he doesn't make a strong case for pushing the pendulum in the other direction then he'll just get drowned out by the echo chamber. Sometimes the plucky underdog has to shout a bit more loudly than is considered polite.

Maybe one could argue that 'survival of the fittest' is working as intended here but perhaps the tipping point is occasionally in need of a nudge.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#42
post #36
post #7

Next time, try dropping jQuery, too, and just using vanilla JavaScript. Just for fun. Simple DOM manipulation is now as simple in vanilla JavaScript as jQuery, with the only big advantage jQuery has now is if you're animating. You may find you're not missing much. You'd have to get used to slightly more involved Ajax syntax, unless you can target only new browsers, in which case the `fetch` API is just as convenient…

Check out https://developer.mozilla.org/en-US/docs/Web/API/Web_Animati... for animation without jQuery

Thanks, you're absolutely right. Web Animation API is one of the few new JS APIs that I haven't explored much, and I see I've been missing a lot. I tend to use CSS animation in production for most animations whenever I can, but I'm definitely going to keep my eye on support for the Web Animation API (although I'm guessing it won't be hardware accelerated like CSS for a while, if ever).

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#43

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

FYI, none of the code on your site works for me, possibly because I have cookies and localStorage disabled in my browser. Not sure if this is specific to your framework or a quirk of the website itself (hopefully not the whole framework, as I don't understand why this requirement would be imposed if not actually needed by the app that's using it... since the fundamental premise of the framework seems to be "it's lightweight").

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#44

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

I was actually just about to use jQuery + PJAX on a new project, but this looks much better! Perfect timing.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#45
post #7

Next time, try dropping jQuery, too, and just using vanilla JavaScript. Just for fun. Simple DOM manipulation is now as simple in vanilla JavaScript as jQuery, with the only big advantage jQuery has now is if you're animating. You may find you're not missing much. You'd have to get used to slightly more involved Ajax syntax, unless you can target only new browsers, in which case the `fetch` API is just as convenient…

http://vanilla-js.com/ "Vanilla JS is a fast, lightweight, cross-platform framework for building incredible, powerful JavaScript applications." "In fact, Vanilla JS is already used on more websites than jQuery, Prototype JS, MooTools, YUI, and Google Web Toolkit - combined."

That's classic, how had I missed that. And it's pretty old, doesn't even feature cool new DOM APIs like the Selectors API (ie, `document.querySelector`). Which allows the exact same syntax as jQuery (although it obviously returns a DOM element instead of a jQuery object).

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#46
post #10

I found this interesting because it seems to have been written by a person who learned Angular before jQuery. I haven't run into that before. Maybe I'm getting old.

I found that odd. I do worry that many people use technologies because other people working at a completely different scale or in a completely different domain have hit a ceiling which wouldn't really apply to most people. They are convinced to start with a more complex and more difficult technology that's solving problems they are unlikely to be facing any time soon. 1. NoSQL traditional RDMS because of scaling/shar…

That's not exactly the way I think of it. I try to be pragmatic about my tech choices, even if I might be wrong at times.

To pick on your NoSQL example. There was one project where I had a large set of records which were all JSON in a text file. There was no one set structure for it. Attempts to set up proper MySQL tables for these records didn't work out so well. It was only after the pain of trying that I decided that MongoDB made more sense for this "collection of documents".

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#47
post #38
post #13

Earlier quoted context omitted.

What's the big advantage of jQuery with animating? Are you referring to the animation built into jQuery?

Actually, looking over the new Web Animation API, it looks like jQuery doesn't even offer much of an advantage for animations as long as you're targeting new browsers that have the Web Animation API (yes, I was referring to the animation support built into jQuery).

Ah, ok. Yes, there are much better options out there than using the animation jQuery offers. At minimum you can use CSS3 transitions and animations before even getting to the Web Animation API. They would likely serve most needs nicely for regular day-to-day sites.

If one really wants to use the jQuery animation options, there are plugins that will try to shift them to CSS3 options instead, but keeping the same syntax.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#48

Amazed at how Angular has created a generation of programmers that accept 2-way data binding and MVC as "the only way" to develop web apps. JQuery encourages more fluent, purely functional reasoning, and one-way data binding of immutable data objects.

Functional, yes. I can't think of too many cases where JQuery has every prevented me from mutating anything.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#49

Earlier quoted context omitted.

My friend was brought in by a client after the previous contractor had spent 300+ hours coding a simple organizational website - here is who we are, here is our phone number - using node.js. I doubt the website will ever see more than 20 concurrent visitors.

Even still, that's just the completely wrong technology to use for something like this regardless of scale. It sounds like it's literally static content. Just write an HTML file directly if it's a single page, or use something like `Assemble` to get easily re-usable partial support if you have multiple pages that want to share a header and footer or something.

It was 5-10 pages. Static content. Yeah, even if they had 10k concurrent users node.js would have been the wrong technology.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#50

Earlier quoted context omitted.

Well, I actually learned Angular 2 before I learned Angular 1.

This is an extremely confusing statement, considering that Angular2 is only at RC5 and has had many major breaking changes to the API and core components ranging from 3 completely different router builds, introduction of NgModules, greater integration with Observables, a compiler still being developed, etc all since it left "Beta" in May. I'd have to guess you left Angular2 to go back to Angular1 considering the curr…

Not really. I'm more of a backend developer, but around the time it went beta (early 2016) I felt it was a good time to be ahead of the curve. So I started learning it with no Angular 1 experience. I've followed it through the betas and RCs.

I recently picked up Angular 1 just because it seemed like a good idea (I often mentor others), not because Angular 2 wasn't in a good state. (If I had to do a project today, I'd probably go with v1, just because the ecosystem feels richer)

Post reply on HN