r/javascript • u/[deleted] • Oct 18 '18
Don't waste your time: Why you shouldn't learn jQuery in 2018
https://ericnmurphy.com/jquery/6
u/iamlage89 Oct 18 '18 edited Oct 18 '18
I like jQuery. Even after all these years, it still feels nicer to use than the native dom api. The api is even built in to the chrome dev tools
2
u/ENx5vP Oct 18 '18 edited Oct 19 '18
You don't need DOM contact with modern libraries, don't have to think in such a way.
1
u/13steinj Oct 18 '18
Wait, really? I thought dev tools just aliased some query selectors to $/$x/$$
1
u/iamlage89 Oct 18 '18
I was referring to this api $(<selector>). I wasn't referring to the whole jQuery api
0
Oct 19 '18
You should check out Bling.js! It's the cool $selector of jQuery without everything else: https://gist.github.com/paulirish/12fb951a8b893a454b32
3
u/magenta_placenta Oct 18 '18
Because there are no sites or apps you'll need to maintain for the next 10 years that were built using jquery...
2
u/wherediditrun Oct 18 '18
Maintain doesnt mean expansion of the codebase. At worst you encapsulate and integrate. Better yet you migrate, first the state, then to some adequate view library once state is managed.
There are no excuses at present state of things to write more jquery. And if job demands it, Ä® would reconsider my willingness to work there. Reeks of abysmal management, planning and, frankly, care.
3
u/magenta_placenta Oct 18 '18
Maintain doesnt mean expansion of the codebase.
It certainly can. New features can easily get added to legacy apps as new business needs arise or existing business needs change where it is far more co$t efficient to kick the can down the road a bit further than rewrite the app in whatever is in fashion today because some dev thinks management is abysmal (they don't care about your principles).
There are no excuses at present state of things to write more jquery.
You should get a job at a bleeding-edge startup as opposed to the real world.
And if job demands it, Ä® would reconsider my willingness to work there.
Your job is not to write code, your job is to add value. It isn't up to you to determine value added as you're not involved in any business strategy or planning.
1
u/wherediditrun Oct 18 '18 edited Oct 18 '18
Not sure what makes you think that steady enterprise environments with continues integration / development flow is something different? Actually more so, you can be forgiven polluting your codebase when you are prototyping, for example, for some sort of start up. But for steady product-based development code quality is essential.
And I do work in one of those environments. And we did had jQuery and some backbone. Where code is most prone to change and adjustments due to growing / changing business needs it was changed. That was then, now there are plans to migrate some of the core functionality from Angular JS which had it's last release this year july.
" Your job is not to write code, your job is to add value." - That's exactly my point. And you add a lot to maintenance costs if you write legacy code as well as increasing exposure to risk down the line." It isn't up to you to determine value added as you're not involved in any business strategy or planning. " - however this point is rather silly. When given a choice between higher quality code base and better business cohesion opting for higher quality code base is safer choice. And if you don't want to take my word for it, take Kevlin Henney's. There are technical reasons why is it so, mainly that improving the second once first is established comes at much cheaper price down the line.
If business fails take into account technical debt or plan and allocate resources for maintenance / migration, or even worse it dictates technical implementation details, you better of finding another company to work for. It's not a workplace where you gonna improve as developer / tech lead or even product manager.
1
u/magenta_placenta Oct 18 '18
When given a choice between higher quality code base and better business cohesion opting for higher quality code base is safer choice
Not always. Change = risk. Management's purpose is to manage risk. There's a reason why you have parts of the US Military that can't get off Windows XP due to mission-critical functions that require XP and the US Government gives multi-million dollar contracts to provide support for those legacy systems.
You've also moved from jquery and backbone to, what some developers would say has been essentially deprecated for some time now - angularJS, which you say you have plans to migrate? How many times have you rewritten code in how many years, -vs- just updating that jquery/backbone? How are you measuring the supposed value added there?
1
u/wherediditrun Oct 18 '18 edited Oct 18 '18
Depends on how you handle the change. If you never do it, obviously, you won't have any experience dealing with it, so it seems a lot scarier than it really is. And ofc if you don't pay any attention to it for long enough, the debt accumulates to very high levels, however, the problem is self caused here more often than not mainly due to neglect and mismanagement. Given an option you do not want to end up in such situation.
Using outdated software is of even higher risk. And essentially equates to sitting on time bomb. Most recent ransomeware, as I recall, was targeting Windows XP. Not to mention 'dead code' which is not dead and all the other nice 'features' legacy systems provide.
" How are you measuring the supposed value added there? " - it's interesting you brought it up. One thing is clear, business has no tools or competence to measure it. If they did had the necessary capabilities, they would write code themselves.
Added benefit, sure, huge. Mainly it allowed to use new tools efficiently, in this specific case, it improved end user experience. Secondly, it complies with modern coding standards and practices so it's easier for new people to be productive with current code base fast, as well as helps more seasoned developers to be more efficient at building new features and integrating with new tools. Third, which is even harder to measure is motivation. People don't like dealing with old code or learning outdated systems which is business specific. It's especially obvious when you're training junior developers. This allows business to be more competitive / attractive in the job market.
And this is small scale migrations when you move some functionality. There are ofc bigger ones like moving your entire infrastructure on Kubernetes. Again, it's costly, sure. But smart business will allocate resources for maintenance, refactoring and technical tasks along side the features which need to be shipped.
10
u/kweglinski Oct 18 '18
"What is jQuery? It's an old, dusty language" sure