15 ms·
> As a senior tech manager php and Jquery allow me to show functional prototypes quickly and easily get buy in from other department stake holders I totally ge
by monoideism 7y ago
> As a senior tech manager php and Jquery allow me to show functional prototypes quickly and easily get buy in from other department stake holders
I totally get it if you prefer to leverage your knowledge of jQuery, but modern JavaScript is just as quick to use. Eg, `fetch`, `querySelector`, and many more. Combined with modern css with flexbox and grid, and prototyping becomes very quick.
- kyriakos 7y agoI think the comparison is not between jquery and native Dom functions but between making something quickly with jquery compared to using angular or react for example
- monoideism 7y ago> I think the comparison is not between jquery and native Dom functions but between making something quickly with jquery compared to using angular or react for example Probably. I was just making the point that jQuery is no longer needed for most use cases. Lots of folks have no idea what the latest browsers are now capable of.
- mharroun 7y agoI'll admit as I moved into managmemt js has also improved. These prototypes are tossaways so it's just faster for me.to grab jquert. (Btw I love react and use it in any serious project... but each to definitely has its place)
- te_chris 7y agoModern JS is a total shit show of competing build tools, APIs that only work in certain ways in certain places, NIH reinventing the wheel. Thankfully there's some standardisation now, mostly due to the heft of Facebook, but it's still some much more work than it needs to be, espeically on the server compared to other web stacks like Elixir Phoenix, Rails, Flask, even Laravel (despite it's frustrating APIs).
- monoideism 7y agoI'm talking about vanilla JS, no build tools. Totally different than server-side coding.
- sethammons 7y agojQuery: include this lib, modify DOM. Modern JavaScript: traveling menagerie of package managers, compilers, build tools, etc. Now that is all in place, modify DOM. At least, this is my impression from the outside. The last time I actually wrote js was around a decade or more ago.
- SparkyMcUnicorn 7y agoThe parent comment is referring to vanilla JS. Just write and serve .js files. The tools you mentioned are common for frontend frameworks and such.
- martin_a 7y agoAs someone who is not very familiar with JS in its multitude of variations this is what it feels like to me. Somebody told me to try Vue and while reusability of components is surely nice to have I feel kind of lost when all I need is a popup when a "save action" was successful. What about jQuery? Is it still the go-to for simpler things?
- monoideism 7y ago> What about jQuery? Is it still the go-to for simpler things? Unless you need to target older browsers (like any IE, really), I'd just use vanilla JS. Vanilla JS means no packaging or build process needed. Just create write a JS file, reference it in a script tag in a basic `index.html`, start a web server (like `python3 -m http`) and you're good to go. Spend a little time learning about flexbox and grid CSS APIs, and you don't even really need CSS framework if you're a decent designer (if not, use Bootstrap or some other CSS framework). If you're targeting older browsers, like IE, then yes, it's probably a good idea to use jQuery and some CSS framework like Bootstrap. Absolutely no need for Vue.js or React if you're just doing a very basic UI (however, note that basic UIs have a tendency to become more complex with time, so for that reason most JS devs start with something like Vue.js even if it's not needed initially). (I'm a senior software developer working in frontend development exclusively for the past 5 years, but have been using JS since 1998, and jQuery since like 2008 - I left the software industry for a number of years after the dot.com bust and came back a decade later).
- simion314 7y ago>but modern JavaScript is just as quick to use this is not true. There are many APIs in JQuerry that are shorter, nicer to use and totally missing in pure JS. there are JQuerry methods that workaround HTML5 and old HTML(quirks mode) differences, there are functions like wrap,unwrap, sibling, parents,find,is,css that replace many lines of vanilla JS. I am not saying that JQuerry is the tool for building a complex SPA , it has it's uses and vanilla JS is inferior for those uses, for a simple form where you want to check the input JS is fine.
- monoideism 7y ago1) It's jQuery, not "JQuerry". I've been using it since 2008, and Prototype.js and script.aculo.us before that. 2) For quick prototypes, I can't imagine why you'd need to accommodate pre-HTML5 HTML. We're discussing quick prototypes, not production sites targeting browsers going back a decade. 3) VanillaJS equivalents are slightly longer than jQuery snippets, mostly because the API names are a bit longer: css: // jQuery newDiv.addClass('foo'); // Vanilla newDiv.classList.add('foo'); siblings: // jQuery const nextElement = $('#wrap').next(); // Vanilla const nextElement = document.querySelector('wrap').nextSibling; etc etc. If the extra verbosity bothers you, you can always alias `document.querySelector` as `$`, or `sel`, or whatever. Then you get stuff like: // jQuery const nextElement = $('#wrap').next(); // Vanilla const nextElement = sel('wrap').nextSibling; And yes, the jQuery method names are a little shorter, but for quick prototyping, I'd rather use something that I know can be run on any modern browser, with no build step or library required. For production apps, I'll 99% of the time use a framework, either React or Vue.js. I get that not everyone prefers that. That's OK.
- simion314 7y agoYou chose the functions that are the simplest , maybe this are the ones you use but there are many more, like do this in JS. i gave other examples like .is("Lvisible") .parenents , wrap, unwrap, and the one I use a lot .css() .after(), .append() etc . and what makes the API neat is you can chain methods where DOM APIs return special collection that you have to use with for(i = 0; .... JQuerry might not be the tool for your job but this not makes the fact it's API is nicer, powerful then pure JS . check the anti-jQuerry page http://youmightnotneedjquery.com http://youmightnotneedjquery.com and you will see that in the end you have to reinvent yor own jQuerry
- skinkestek 7y agoIt might be just as quick. But using modern Javascript frameworks makes you completely dependent on Javascript, unless you want to put in some effort to get server side rendering working). And as every good web developer back in 2009 could tell you this is a bad idea as it makes sure the app can never approach the gold standard: to work in every browser (and work better in modern browsers). In fact it is so bad now that we are repeating the IE6 problems even though all major prowser have all the APIs we could only dream of back in 2009. Here's a secret: I'd say it is still a bad idea to use Javascript application frameworks on most web sites, and possibly many web apps but it is really nice for consultants, training providers and developers who need job security ;-) As a full stack developer and a consultant who care about the web and about my clients there are times when I can recommend frontend applications but mostly I just hold my nose, accept what sales have agreed with the customer and try to make the problems as small as possible ;-)
- rawfan 7y agoI think you misunderstood. The previous poster meant modern Javascript WITHOUT a framework. These days I would just go with AlpineJS, tbh. It’s a mini-framework that solves the most common problems. Best thing for people who don’t want to write js at all.
- monoideism 7y agoFirst of all, I wasn't referring to using any JS framework. I was talking about vanilla JS. Did you know that you can use JS modules now in every major modern browser (Chrome, Edge, Firebox), with no build tool required? Now of course, for production deployment, you'll want to do a build so you can hit older browsers and less common browsers, and/or for performance reasons. And yes, for "brochure sites", nobody should be using anything except for a static site with bits of progressive enhancement Javascript. Agreed. On the other hand, you use the word "app". For a true app, you're going to need a JS framework. Trying to build an actual app, like Gmail or Slack, is a fool's errand using only server-side rendering. It's possible, but why would you want to do that to yourself? And even then, the user experience would be awful. I really think web devs need to do a better job both among themselves and for the clients in differentiating between informational sites and brochureware, and true web applications (usually desktop app replacements, or related). The former should be built using static site generators and just bits of JS, whereas no-one is going to try to build a Slack competitor using a static site generator. There are a few projects I've seen that fall in the middle of the two, but those are relatively rare. Most of the time it's very clear if you're building a site or an app.
- dagw 7y agobut modern JavaScript is just as quick to use. Eg, `fetch`, `querySelector` That's one, trivial, part of JQuery. The real strength of Jquery is the countless UI widgets and libraries built on top of it. I can knock together a quick and easy UI using Jquery, Bootstrap and a handfull of Jquery UI widgets faster than with just about anything else.
- monoideism 7y agoYes, I know. I used jQuery for 10 years. Now, after learning new APIs for 2 years, I can put together a quick and easy UI using vanilla UI and CSS as fast as I could with jQuery. Particularly grid and flexbox have made a big difference (they fill the role of the old grid CSS frameworks, including that part of Bootstrap). Your mileage may vary. Also, the majority of third-party jQuery plugins are no longer maintained. Most of the JS world has moved on.