3 ms·
Out of curiosity is jQuery really that bad ? I am not exactly sure why I would not want to use jQuery and prefer SPAs. What is actually missing in jQuery lodash
by thecleaner 7y ago
Out of curiosity is jQuery really that bad ? I am not exactly sure why I would not want to use jQuery and prefer SPAs. What is actually missing in jQuery lodash handlebars combo ?
- dymk 7y agoManaging anything more complicated than only a slight enhanced page quickly becomes a big ball of mud when you use jQuery and handebars (fancy string interpolation) for state management and UI updates.
- deleted 7y ago[deleted]
- thecleaner 7y agoI see. What do you use and why ?
- dymk 7y agoReact+Redux. I can focus just on what the structure of the UI should be and not the nitty-gritty of actually updating it (React handles that). State management through Redux so I can consolidate where application state is held, and testing it is straightforward and a feature of the library.
- ChrisCinelli 7y ago8 years ago I was using jQuery and good self contain JS objects. Each of them had responsibility over specific part of the DOM. The beauty of that is that in that why you can keep thing simple and updates already well optimized by default. I understand that by default with JS you can write code that in one place touch every part of the page. But no framework or language protect you from bad code practices and bad abstractions. They may avoid it at a specific abstraction level but unless you are disciplined and you know what you are doing, you are still screwed beyond that. Component libraries like React did not invent encapsulation, abstractions, separation of concerns, loose coupling and high cohesion, they just enforce them at their level of abstraction but let you paying the "unoptimized" recalculate all by default. In fact I saw a bunch of code written in React that are big balls of mud communicating together without a good abstraction logic. Redux, in the React ecosystem, is pretty good at keep the state in one place but pretty bad to hide implementation details to those component that should not be concerned with them... result? Refactoring a reducer can results in refactoring a lot of smart components. And the verbosity of using Redux has always been off the chart. The best part of React documentation is here:https://reactjs.org/docs/thinking-in-react.html https://reactjs.org/docs/thinking-in-react.html - Especially in steps 3 and 4. Learn that and use it with the framework of choice or just vanillaJS... You do not use that and you will be in trouble with React or any other framework.
- bobthepanda 7y agoAll your template-based logic is in one place. Rather than listen to events and then executing actions using a mishmash of selector-fu, you can have a self-contained template that doesn’t care about other parts of your page. It hides a layer of nitty-gritty from the developer.