Live data from Hacker News

How to avoid common SPA pitfalls when using third-party plugins

blog.isleofcode.com

1–10 of 41 posts

Re: How to avoid common SPA pitfalls when using third-party plugins

#3
I liked his examples, though I disagree with his conclusion (don't use jQuery). It seems like the real conclusions are:

1. understand the language you're using (this would solve the `bind` examples); and

2. learn how to use your libraries properly.

Otherwise, the "don't use $TOOL, because misuse can cause $BAD_THINGS" line of thinking is nearly limitless in its application (jQuery, cars, circular saws, ...).

Re: How to avoid common SPA pitfalls when using third-party plugins

#5
Most of OP's complaints come from the misuse of JQuery, including compounded performance issues when paired with a SPA framework (in this case Ember, which IIRC has a dependency on JQuery either way). Slow + Slow = More slow.

Honestly it's a library. Use it, don't use it, replace it, it honestly isn't worth a million identical arguments. People like to use JQuery as a microcosm for bad javascript practices but guess what JQuery didn't make you do it! It's just a library.

There is no real reason to avoid JQuery. Sure you should, as a good developer, explore alternative solutions for different problem sets. Maybe those alternatives become the standard for your team, maybe they don't. But unless you made a meaningful discovery that can add to the conversation, you don't need to make another blog post about it. Ugh.

Re: How to avoid common SPA pitfalls when using third-party plugins

#6
post #3

I liked his examples, though I disagree with his conclusion (don't use jQuery). It seems like the real conclusions are: 1. understand the language you're using (this would solve the `bind` examples); and 2. learn how to use your libraries properly. Otherwise, the "don't use $TOOL, because misuse can cause $BAD_THINGS" line of thinking is nearly limitless in its application (jQuery, cars, circular saws, ...).

Author here:

I whole heartedly agree, which is why with each point I made I did more than just list what was bad, but how to do better, even with jQuery. The real reason not to use jQuery isn't because jQuery is bad, it is because as a tool it / it's ecosystem is poorly prepared for dynamic html, so if you are going to use it, you need to know the limitations and challenges it brings.

Re: How to avoid common SPA pitfalls when using third-party plugins

#9
post #4
post #2

The real reason to avoid single page apps.

"The real reason to avoid JavaScript" Ooops, wrong decade

Honestly, more like "the real reason to avoid programming"

If you are the type of person who likes to paint ideas and approaches in black and white, pointing out only the upsides of the things you like and only the downsides of the things you don't like, then you're going to REALLY hate programming.

Re: How to avoid common SPA pitfalls when using third-party plugins

#10
post #5

Most of OP's complaints come from the misuse of JQuery, including compounded performance issues when paired with a SPA framework (in this case Ember, which IIRC has a dependency on JQuery either way). Slow + Slow = More slow. Honestly it's a library. Use it, don't use it, replace it, it honestly isn't worth a million identical arguments. People like to use JQuery as a microcosm for bad javascript practices but guess…

Yes, some of this is from the misuse of jQuery. But I fix that misuse a lot, so I felt it needed explicitly pointed out.

But many of these complaints have nothing to do with misuse and everything to do with either a lack of awareness about selector consequences, or a decade of built up code debt in the jQuery plugin ecosystem.

All of these examples are true for all JS frameworks, even non-SPA frameworks. Dynamic DOM is a problem for code that wasn't designed to clean up.

There is a real reason to avoid jQuery, that reason is that you want your app to work well. Blindly reaching for a tool from the static age will bite you.

> But unless you made a meaningful discovery that can add to the conversation, you don't need to make another blog post about it. Ugh.

Guessing this is yours ;)

Post reply on HN