DEV Community

[Comment from a deleted post]
Collapse
 
twigman08 profile image
Chad Smith

The post has many merits which are true and I myself have been using less jQuery in my every day work.

What I don't agree with is pretty much saying all you write with jQuery is spaghetti code, because it is imperative. I don't agree with this because imperative programming is a paradigm just like OOP, functional, or the logic paradigm. To blame jQuery for that is wrong. Feels like you were using the paradigm incorrectly. I can write spaghetti code in any paradigm. I can easily write some of the worst spaghetti code you've seen using a component based approach similar to react (I have seen it first hand).

A programmer writes spaghetti code not a library/framework. Blaming a framework for it is just an easy way out in my mind.

Collapse
 
belhassen07 profile image
Belhassen Chelbi

I agree , but I said it encourages writing spaghetti code, and in other comments I've agreed that sometimes we found a well organized code with jQuery. For React, obliges you to write a component based approach, but if you're using React, you won't use it to write some "commands" to handle some DOM elements, Jquery is used a lot to do so, And as I said also, I'm not comparing jQuery with React, it's just unfair to do that. So yeah, It may be my problem not using jQuery with a good organized code, but what I said is that it discourages writing a mainatainable code and it's just nonsense to include it so you can write some lines of code for performance sake.
Great point Chad, I'm open for changing some thoughts, thanks for sharing ♥