5 ms·
Is it weird if I still use vanilla JS most of the time? And some jQuery where absolutely needed?
by prox 6y ago
Is it weird if I still use vanilla JS most of the time? And some jQuery where absolutely needed?
- pstadler 6y agoThis IS weird, because of the jQuery part.
- jailbird_bd 6y agoCould you please describe why? jQuery is basically just a bunch of helper functions which makes your JS code a bit more readable and takes away the worry about browser (in)compatibility. Is that bad?
- rendall 6y agoNo. It's not bad. As with everything in tech, there are: 1) tradeoffs, preferences, exigencies of use-case 2) devs who conflate their specific use-cases with universal truths 3) fickle winds of fashion affects tech as much as any human endeavor. Right now jQuery is out and React is in As for jQuery specifically, there has been at least 2 trends militating against it: a wider industry move away from patterns of direct DOM manipulation into virtual DOMs (i.e. using frontend frameworks); and a more widespread acceptance of functional programming techniques while jQuery is inherently "impure"
- FpUser 6y ago>"As for jQuery specifically, there has been at least 2 trends militating against it" Using virtual DOM does not give much benefit if at all on modern browsers. Functional programming is just one of many existing paradigms and not a silver bullet. One does not need to plug every hole with it.
- deleted 6y ago[deleted]
- rendall 6y agoOf course! I would note in passing that a description of industry trends is not an endorsement of them. There are lots of reasons for trends beyond pure rational technical strategy.
- FpUser 6y agoSo far I was fortunate that in most cases I am free to choose the tech stack for the products I make. I pay very little attention to "industry trends" (basically what FAANG tells us to do) and choose what works best for my business ROI wise. As for developer pool - when I need to hire subcontractor I've never had problems finding one with enough qualifications in whatever area I would need. Btw all subcontractors I've ever had are remote since year 2000
- jailbird_bd 6y agoIf you're not trying to build an SPA with them, not weird at all. For basic crossbrowser compatible interactive elements, vanilla JS and/or jQuery are/is more than enough. As long as it's easy to maintain, just use what you are familiar with and gets the job done.
- FpUser 6y agoWe've built SPAs as a part of the larger project using exactly this. Plain JS with a couple of libs that address specific needs (graphics for example). All work fine, simple to maintain and does not require that insane amount of infrastructure.
- kikimora 6y agoCan you share some insight about your project? React and redux didn’t happened for no reason. However I think they are too heavy and there are ways to solve same problems with basic tools. Your case may shed some light on to how this can be achieved without react/redox overhead.
- FpUser 6y ago>"Can you share some insight about your project?" Not sure what particular insights. Well here is some example: state management. It is basically split into 2 parts. One part is the actual business object that matters and is a slice of full data on backend. It is a class with methods that take parameters and modify state when executed and broadcasting fact of said modifications so that the UI is aware. Executions of said methods also causing data exchange with the backend using JSON based RPC. Simple example would be Customer with get/set Name/Alias/DOB etc. Then there are web components and those keep their own state that is limited strictly to presentation issue. For example Currently active form of the application. It is a big area in general with lots of details and requires way more than a simple post to describe. Unfortunately we do not contribute to open source so can't really share any code. So structurally the app is fairly simple. Some JavaScript files that are being merged when posting to production and backend server written in C++ accessible through JSON based RPC that can serve thousands of requests per second on single computer with few real cores without breaking much sweat.
- jerrygoyal 6y agoyou know http://youmightnotneedjquery.com http://youmightnotneedjquery.com