DEV Community

[Comment from a deleted post]
Collapse
 
jasongabler profile image
Jason Gabler • Edited

You and I have very different understandings of "spaghetti code". Spaghetti code refers to poorly structured, circuitous programming that is difficult to understand and even harder to maintain. When used properly, jQuery actually promotes the opposite experience as the nitty gritty and less pretty bits of JavaScript are encapsulated in a library. Any coding venture can become spaghetti, but that is much more a result of the choices of the developer rather than the platform. I'm not advocating the use of jQuery, but it is certainly not a promoter of spaghetti coding.

Similarly, you may not feel as though you are programming when employing jQuery, but you are. You are programming just as anyone would with any library or API. If you were to code in C instead of assembly language, or assembly language instead of raw machine code, do you get the sense that you're not really programming? Perhaps we should go back to toggles and vacuum tubes so we can feel like we're keepin' it real? Of course not, to all of the above. Instead of your feelings, focus on the facts. Again, I'm not advocating the use of jQuery, but when you use jQuery you are programming.

Finally, 1kb vs 93kb doesn't matter when it comes to JavaScript. When visiting the vast majority of websites, your browser caches jQuery on the first HTTP(S) call or it already has cached the requested version from some other website you visited last year when that version was new.

You are, of course, entitled to your opinion. You are apparently not a fan of jQuery. But when you claim a technology shouldn't be used, you've got to make your argument out of something more than feelings and a jaded fandom.

I use jQuery often. I'm not a fan or a hater. It's got its problems. But, it's easy, fast and it works quite well within its domain. I use it even for small things because I find JavaScript to be cumbersome when I just want to get something simple accomplished and not have to write 20 lines of not so straightforward code. Some might call that lazy. I call it saving time and money.