Live data from Hacker News

jQuery v4.0 Beta

blog.jquery.com

291–300 of 404 posts

Re: jQuery v4.0 Beta

#291

Earlier quoted context omitted.

This very much depends on what you are building and how experienced you are. If you just want a few pages, no need for background workers or database migrations, PHP is still the king. You download one of many single-executable LAMP servers, and start writing your index.php. Deploy? Just copy files to server. Zero downtime deploy? Copy files to server and use symlink to atomically switch versions. Dependencies? Compo…

You haven't worked with Vercel. Just connect your git account and you have a fully git-flow based server, with preview urls for every PR. Especially for small projects ideal. Running it on a VPS is a skill on it's own, for both, if users had known to use NVM (which is explained in most top articles in Google) it would have not been a problem and if they don't know they should accept the learning pains of running prod…

> Upgrading PHP version is even more painful, I've tried to do version updates, and was alway easier just to build a new server.

I upgraded PHP 7.2 to 8.3 for a business client yesterday.

It was a CentOS VM.

It took maybe 5 commands, no server restart involved either.

I could barely bill an hour and that is because I kept tail -f their logs to see if everything went smooth. And it did.

How is that painful?

Re: jQuery v4.0 Beta

#292
post #236

Oh I loved jQuery. Anybody remembers DataTables https://datatables.net or X-editable https://vitalets.github.io/x-editable/ ?

Remember? I still use DataTables.

Many third-party themes still package it. I've looked at alternatives, and they're either less function with way more config, or they are trying to be Excel clones.

Re: jQuery v4.0 Beta

#293

Earlier quoted context omitted.

There's 2 types of web pages. Websites and web apps. If you're building a web app, you're going to want a framework that isn't going to fall apart the second things start getting complicated. If you're making a little marketing website, sure, sprinkle some jQuery on there and call it a day. Probably better for performance and SEO unless you want to spend 10x as long micro-optimizing your SSR. Point is, there's differ…

It’s all the same. The difference is not in the product but in the developer’s perception of the product. The code and the user don’t notice the difference, just the developer in the middle. There are those who can dynamically put text on screen and those who need just a little help to dynamically put text on screen.

> the user don’t notice the difference

Users do notice the difference is large JS framework driven applications.

Re: jQuery v4.0 Beta

#294
post #256

Earlier quoted context omitted.

Yesterday I was checking HN from 10years±2weeks ago and guess what the top posts were... "Why you need jQuery" and "You might not need jQuery". I'm too young to know about those days but I guess not much has changed in relation to people's attitude towards jQuery.

What's changed is the billion dollar tech industry invested in convincing people that JQuery is a dead and obsolete technology. For some reason, JQuery is the exception to the general rule of seeing a mature, battle-tested library as a sign of quality.

The problem jQuery was solving was to provide a usable abstraction over an inconsistent platform for core functionality like event handling and DOM manipulation.

The point of the last decade and a half of standards work was to eliminate that problem, and it has at least moved it from "core web functionality" to more complicated areas like bluetooth, 3d rendering and audio, which jQuery's goals do not include handling.

Is it urgent to remove jQuery from projects? Not really. And it's good the jQuery team maintain the project for that reason. Certainly some projects have gotten performance gains out of removing it, but part of the work they've done in 3.x and now 4.x is arguably jQuery removing stuff internally and replacing them with the now reliable browser APIs.

But on the other hand, is there a great argument for including jQuery in new projects? This is also a "not really".

Re: jQuery v4.0 Beta

#295
post #254

Earlier quoted context omitted.

It isn't missing. Javascript was created to serve a specific purpose, which didn't include left-padding text in a terminal. Most language I'm aware of wouldn't have that in their standard lib. If you want Javascript to act as a drop-in replacement for C++ or Java or some other general programming language (which Javascript was never intended to be) don't act as if needing to write libraries to cover that missing func…

> Most language I'm aware of wouldn't have that in their standard lib. Python has str.ljust [1] (and str.rjust [2]): > Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s). [1] https://docs.python.org/3/library/stdtypes.html#str.ljust [2] https://docs.python.org/3…

C has it in their standard library, basically forever. See the list of specifiers to printf. C! If it fits into the C standard library, it's not bloating the Javascript standard library.

Re: jQuery v4.0 Beta

#296

Earlier quoted context omitted.

> you can have that with server-side rendering plus yes, we use PHP for this which is much simpler to grasp than JS-SSR

plus you don't need to restart any services or rebuild servers. Just git pull and you have the new code on the live server without even a second of downtime

watch -n 1 git pull

Re: jQuery v4.0 Beta

#297
post #254

Earlier quoted context omitted.

It isn't missing. Javascript was created to serve a specific purpose, which didn't include left-padding text in a terminal. Most language I'm aware of wouldn't have that in their standard lib. If you want Javascript to act as a drop-in replacement for C++ or Java or some other general programming language (which Javascript was never intended to be) don't act as if needing to write libraries to cover that missing func…

> Most language I'm aware of wouldn't have that in their standard lib. Python has str.ljust [1] (and str.rjust [2]): > Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s). [1] https://docs.python.org/3/library/stdtypes.html#str.ljust [2] https://docs.python.org/3…

Ruby and PHP both have string padding functions. So does Swift. (edit: and as Macha points out, C and any language with printf functionality, like Perl.) It’s not that uncommon.

(I was going to joke that TRS-80 BASIC had it circa 1979, but it turns out that it would be a two-step operation: Python’s str.ljust(40) would become LEFT$(STRING$(40, " "),40) .)

Re: jQuery v4.0 Beta

#298
post #89

Earlier quoted context omitted.

This is incredible and such a great ad for jQuery. It's almost as if the creator(s) built that site ironically. So many examples are way clearer and easier in jQuery, like this one: JQUERY: $(el).toggle(); IE8+: function toggle(el) { if (el.style.display == 'none') { el.style.display = ''; } else { el.style.display = 'none'; } } Gotta love that "modern" triple attribute repetition. From: https://youmightnotneedjquery…

> Gotta love that "modern" triple attribute repetition. You can golf it down a bit: el.style.display=el.style.display == 'none' ? '' : 'none';

Surely

    el.style.display = el.style.display ? 'none' : ''
(after toggling we've already obliterated any possible third value for it anyway, doesn't seem significant)

Re: jQuery v4.0 Beta

#299
Time to send letters to the core js standards team to ask JR for permission (plus giving him a briefcase and a deus ex machina ;)) to bring the full jQuery treatment into core JS. In order to replace the cumbersome JS things with jQuery. Why always complicate things...

Re: jQuery v4.0 Beta

#300
post #41

I'm consistently surprised by the commenters on HN who seem to think jQuery is just a DOM selection library, when in fact it is a widely supported, incredibly stable tool set for (yes) DOM selection, but also attribute manipulation, Ajax requests, event handling, animation, and general utility functions. What's more, where there _is_ native functionality that replaces jQuery, the API is never as fluent. For work that…

> commenters on HN who seem to think jQuery is just a DOM selection library proceeds to name selection and native functions

> just
Post reply on HN