Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

javascript v jQuery frameworks

LEGEND ,
Apr 10, 2018 Apr 10, 2018

I don't want to stir up a hornets nest here but if devs wants to make some sensible contibutions giving their opinions, without getting personal, please do so.

Materialise.css front end framework now uses pure javascript, rather than dependency on jQuery.

If you compare the current versions of the jQuery min js file and the Materiaise min js - jQuery is 90kb and Materialise is 180kb  the unminified files are 274kb and 369kb respectively.

My real question is this. I can understand a developer who says you should use javascript and not jQuery its crap, given they are writing bespoke javascript and not a javscript framework but when I hear developers say 'great Materialise now uses pure javascript and no need for that crap jQuery now' then proceed to hook up a js file which is twice as larger as the jQuery js file, I think that is a bit suspect.

Bot require initialisation of some kind but that file is only likely to be 10k maybe, so JQquery is still the lighter of the js frameworks.

Why is there a witch hunt in terms of JQuery in this circumstance. I can undertand the bespoke javascript workflow because obviously it is much better in terms of file size.

Hummmmm

Os

2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2018 Apr 10, 2018

I agree with you and why not using jquery... those who needs and are used to... it's a nice library...

anyway, it still worth nothing to have a look on You Might Not Need jQuery

<just in case>it's not a polemic</just in case>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

https://forums.adobe.com/people/B+i+r+n+o+u  wrote

I agree with you and why not using jquery... those who needs and are used to... it's a nice library...

anyway, it still worth nothing to have a look on You Might Not Need jQuery

<just in case>it's not a polemic</just in case>

Ok, thanks for the clarification and your opinion. I just get a bit annoyed when a well followed dev suggests a workflow which is really no better, maybe even worse. Pure js and writing bespoke functions I can understand is better.....no dependency on any js framwork.

Infact I should have provided a better answer to a post earlier by providing a pure javascript solution instead of hooking up the jQuery framework which is overkill to perform one or two tasks, but that's another story.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2018 Apr 10, 2018

This looks like an answer to a question nobody asked, there's lots of those online.

May be more of a class/group project than a true development framework.

Not too shabby for 4 college age guys, but that's about it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2018 Apr 11, 2018
LATEST

If there's any valid reason to reopen this cluster, let me know via PM.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

They are two different things, though I know why many developers do not see the difference.

One is a framework written to support the use of javascript, the other (jQuery) is a javascript abstraction layer, meaning that one does not write javascript but uses a language that must first go through an interpretation process, (the jQuery file) to convert it to javascript, then the converted jQuery code, (now javascript) is run by the browsers javascript engine.

Even though the javascript file for Materialise is bigger than the jQuery file, (so takes longer to download) the Materialise javascript once downloaded will be faster in execution time, providing it has been written correctly, though the same can be said of jQuery.

The main problem with both though is in use. The user must ask themselves just how much of the javascript part of the Materialise framework, or the jQuery main code file is required.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

pziecina  wrote

The main problem with both though is in use. The user must ask themselves just how much of the javascript part of the Materialise framework, or the jQuery main code file is required.

I think that was my main confusion, both are harbouring excessive amounts of redundant stuff and to say one is better than the other just because it uses pure javascript rather than  jQuery seemed a bit disingenuous and more based on a dislike for jQuery, which is fine, rather than ok we have got rid of all the excessive crap which a framework carries with it. As for the execution time I guess it could be a minimal factor.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

LOL, so are you saying that jQuery is impure JavaScript? Before you bite my head off, think how snobby you sometimes treat people who don't share your love for "coding"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

ALsp  wrote

LOL, so are you saying that jQuery is impure JavaScript? Before you bite my head off, think how snobby you sometimes treat people who don't share your love for "coding"

This comes from the bloke that tried to suggest that one of his competitors extensions where jQuery dependent when they were not, most other devs knew that. That makes you pretty  naive and a bit snobby, no?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

osgood_  wrote

As for the execution time I guess it could be a minimal factor.

15 years ago, I would have said it was a major factor, but now we have smartphones that are more powefull than desktops of that time. While most none major site developers do not have to think about file size, (developing for local client use only) network speeds can become a factor for what one uses.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

jQuery is JavaScript. t's just a large file that allows non-programmers to use and reuse various generic functions. If you know how to write JavaScript then you simply decide if you want to take a direct path to a task (write your own) or you want to use a shortcut (jQuery). To an accomplished programmer, the only bright side for jQuery would be if browsers and the W3C adapted some core functions as default behaviors driven via CSS. Otherwise, to a programmer, the argument is kind of like your feelings about coders and CSS and extensions

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

ALsp  wrote

jQuery is JavaScript.

That would be like saying that emmet is html.

They both end up as being the same thing, and can make the coders life easier, but if jQuery was javascript it would be called javascript.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

I really can't respond to your question. I really can't. But I have a whole new vibe for this forum. This is extremely enlightening and allows me to understand a lot of the posts I've seen recently. But I have to ask just one, teeny, tiny question...

In precise terms, what exactly is jQuery? And where would I find evidenced-based and definitive data that clearly makes it something other than JavaScript, and if so, precisely what is the "other" to be called?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

I suggest you go and read J Resig's books in which even he says it is an abstraction layer and not javascript.

My last post to you AL, complete waste of time trying to have a sensible discussion, as you always bring it down to implied insults.

http://www.jquery-tutorial.net/introduction/what-is-jquery/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Well, I can take a few of our scripts and say the same thing. Resig wrote jQuery. He can say anything he wants about it... I guess . But this is how most other people describe him:

John Resig is an American software engineer and entrepreneur, best known as the creator and lead developer of the jQuery JavaScript library.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

pziecina  wrote

(jQuery) is a javascript abstraction layer, meaning that one does not write javascript but uses a language that must first go through an interpretation process, (the jQuery file)

@ALsp you don't agree that it is an abstraction?

ALsp  wrote

In precise terms, what exactly is jQuery? And where would I find evidenced-based and definitive data that clearly makes it something other than JavaScript, and if so, precisely what is the "other" to be called?

JQuery is Javascript based, no one said otherwise, but its an abstraction and interpreted library.

Here is the first statement that JQuery made to the world, from this ideal has anything since changed from this core principle?

jQuery 2006.png

If they strip out all the "necessary markup" and replace it with an alternative API, is that not then an abstraction on top of Javascript?

Are you arguing its not a abstraction?

ALsp  wrote

LOL, so are you saying that jQuery is impure JavaScript?

You feel it is pure?

So if a person learns only jQuery are they correct to put that they know Javascript on their resume? If so, if you as a developer or any company are looking for a "Javascript Developer" to add to your team, start tomorrow and hit the ground running. A person whom only knows JQuery would be qualified for Javascript development ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Yes, I am disagreeing with all of that . jQuery is JavaScript. A person who only knows jQuery would need to know JavaScript in order to know jQuery. I don't know how far back you go with Dreamweaver, but Massimo Foti, one of our early compatriots in extension development wrote a library of key functions and processes to make his extensions easier to keep updated. It was an interesting idea, and many years before jQuery. Similar concept, but purely JavaScript or, if you want to be precise, ECMAScript.

Resig's legacy will be if the W3C uses jQuery, or parts thereof, to make CSS more powerful. But it's still JavaScript. The concept of an abstraction just makes it sound cooler.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Seriously?

ALsp  wrote

Yes, I am disagreeing with all of that. jQuery is JavaScript. A person who only knows jQuery would need to know JavaScript in order to know jQuery.

Your response does little to answer my questions or respond to my statements. Maybe you can try again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Sure. The key is what is an abstraction? Writing functions that take into consideration the 3 primary layers of a web page: structure (markup), presentation (CSS), and behavior, you create an abstraction layer that enables you to write small scripts that do big things. But you have to keep in mind that the core library (jQuery) must be there already. The person writing the stub, or plug-in need not concern him or herself with the nasty details such as browser bugs, deprecated DOM issues, etc. This is the abstraction. For someone writing what Osgood referred to as pure JavaScript, they would attack those issues directly, in many cases that type of programming is more efficient in that you wind up with less stress on the browser, smoother animations, and other niceties. And that's not to say that top-level JavaScript authors do not regularly create their own abstractions. It simply takes more actual programming, because you would not be able to rely on shortcuts, or abstractions created when using the core jQuery library functions. It's really that simple.

This is why many people that write JavaScript would welcome with open arms, the inclusion of jQuery into browsers. That way, we could use what we like of jQuery, and rewrite what we know can be improved upon, and add whatever else we need. Win, win, win.

Other folks have written about this issue in more detail, but that says it in a nutshell.

Or consider this...

Because jQuery contains 12 lines of code to switch common properties, you don't need to repeat it, you simply write a shortcut:

$ (‘body’) .css (‘background’, ‘#ccc’);

This is a shortcut and it is nothing more (or less) than JvaScript. But there is code in jQuery to make that work. And that code is the same code a "pure" JavaScript would use. But that's not to say that a good, and efficient script author would not have his or her own special functions that can be used as shortcuts to change many different attributes on a page. Do you understand what I'm saying?

The misinformation comes in when people start believing that jQuery is something different than JavaScript. It's not.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2018 Apr 10, 2018

Not changing topics here but does anybody remember Yahoo UI.js, Prototype.js,  Spry.js,  Scriptaculous.js, Lightbox.js, SWFObject.js, and MooTools.js?  Their usage declined significantly after  jQuery rose to the top of the heap.     

Nevertheless, I'm looking at a site right now that has to be re-built  because  outdated Web 2.0 JS scripts are not doing the job anymore.     

If it quacks like a duck and swims like a duck and waddles like a duck, it's a duck.  This stuff is all JavaScript.   And so is jQuery.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Yes it is, Nancy. I just hoped I explained what an abstraction is well enough, because that's the key in understanding what jQuery is, and what is not.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2018 Apr 11, 2018
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Lets try yet again, this is what I stated and asked:

W_J_T  wrote

1.] @ALsp you don't agree that it is an abstraction? JQuery is Javascript based, no one said otherwise, but its an abstraction and interpreted library.

2.] If they strip out all the "necessary markup" and replace it with an alternative API, is that not then an abstraction on top of Javascript? Are you arguing its not a abstraction?

3.] You feel it is pure? So if a person learns only jQuery are they correct to put that they know Javascript on their resume? If so, if you as a developer or any company are looking for a "Javascript Developer" to add to your team, start tomorrow and hit the ground running. A person whom only knows JQuery would be qualified for Javascript development ?

And your response was:

ALsp  wrote

Yes, I am disagreeing with all of that. jQuery is JavaScript. A person who only knows jQuery would need to know JavaScript in order to know jQuery.

But now you say:

ALsp  wrote

  • the key is what is an abstraction
  • you create an abstraction layer that enables you to write small scripts that do big things.
  • the core library (jQuery) must be there already.
  • need not concern him or herself with ... details .... This is the abstraction.
  • pure JavaScript ... takes more actual programming, because you would not be able to rely on shortcuts, or abstractions created when using the core jQuery library functions

So you now agree it is an abstraction or you still feel its not as you initially said "disagreeing with all that" ?

So thats #1 & #2.

Now lets look at #3 ...

I asked this ..

W_J_T  wrote

You feel it is pure?

So if a person learns only jQuery are they correct to put that they know Javascript on their resume? If so, if you as a developer or any company are looking for a "Javascript Developer" to add to your team, start tomorrow and hit the ground running. A person whom only knows JQuery would be qualified for Javascript development ?

You've since stated this

ALsp  wrote

  • This is a shortcut and it is nothing more (or less) than JavaScript. But there is code in jQuery to make that work. And that code is the same code a "pure" JavaScript would use.
  • The misinformation comes in when people start believing that jQuery is something different than JavaScript. It's not.

So you would advise that person to state they know Javascript on their resume and hire them as Javascript Developer (note, I never said to use JQuery).

So since they know Javascript from using JQuery (according to you) they could upon arrival to their new job use that knowledge to change this ...

// jQuery

$.post('//iknowjavascript.com', { username: username }, function (data) {

// I use know javascript since I use jquery

})

to this ...

// Vanilla Javascript

var httpRequest = new XMLHttpRequest()

httpRequest.onreadystatechange = function (data) {

  // yippie they know javascript since they use jquery

}

httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')

httpRequest.open('POST', url)

httpRequest.send('username=' + encodeURIComponent(username))

With no hesitation, since they know Javascript and that is what is required of them in their new job.

Those were the 3 questions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

Let me say this another way....

jQuery is JavaScript.

That was the original issue I "discussed" with Osgood and Paula.

The issue is closed as far as I'm concerned.

I then attempted to explain what an abstraction is. Obviously, I failed to do that.

I have no more time for this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2018 Apr 10, 2018

ALsp  wrote

Let me say this another way....

jQuery is JavaScript.

That was the original issue I "discussed" with Osgood and Paula.

The issue is closed as far as I'm concerned.

I then attempted to explain what an abstraction is. Obviously, I failed to do that.

I have no more time for this.

Well thanks for avoiding my statements and questions across your 3 attempted responses, but ok run away if you must.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines