Hacker News new | ask | show | jobs
by maggit 5088 days ago
Sorry, your point about jQuery is off the mark. jQuery is a library (not a framework), and if you are not using libraries you are most likely doing it wrong, in any language!

jQuery does nothing to alter the language, so people using it are still coding pure JavaScript. jQuery itself is implemented in pure JavaScript.

----

There does exist variants of JavaScript, such as Paper.js, Protovis and maybe even CoffeScript, but these are not what the majority of JavaScript users use.

2 comments

I'm not so sure whether jQuery can be considered a framework or not. If you're using jQuery properly ($(document.ready).ready() and so forth) jQuery behaves very much like a framework, with inversion of control and other patterns.

JavaScript in the browser has access to the standard JavaScript and DOM libraries. I really don't think that not using any third-party libraries in any language means "you're doing it wrong". Pure JavaScript/DOM can go a very long way (especially in these days of more standard-compliant browsers), just like pure Objective-C & Cocoa or pure C# & .NET.

Finally, while obviously jQuery does not alter the language, it really changed how people approach problems in JavaScript. Code that uses jQuery looks nothing like code that doesn't use it.

jQuery is big and important and has lots of features that you can use or decide not to use. However, if you decide to implement simple animations yourself in a situation where jQuery would have been a fit, you are likely wasting time and effort.

Using jQuery for this does not mean that you like or dislike the language. That was the point I was trying to refute.

Animations is of course also not the only problem you can solve by using jQuery as a library every now and then.

----

For what it's worth, I don't think jQuery qualifies as a framework in the definition on Wikipedia ( http://en.wikipedia.org/wiki/Software_framework ), but this is besides the point.

The difference between library and framework is quite subtle sometimes and in this case many use it interchangeably. You are correct though, jQuery themselves call it a library.

I don't agree to "does nothing to alter the language" though. It changes the way you manipulate DOM across your codebase. When one says 'library', I assume it's something you make calls to to achieve certain functionality. Like an image library or oauth library.

Also, that jquery is implemented in javascript is not relevant in my opinion. Rails is implemented in ruby. Does that make it not-a-framework?

OK, then we have different understandings of what makes a language.

You said: "the fact that very few people code pure javascript (...) goes to show how much people like it!"

I argue that using jQuery does not change the "pure JavaScript"-ness of any code, just like using Rails does not change the "pure Ruby"-ness of any code, just like using libpng does not change the "pure C"-ness of any code. In every case, it's all in one language anyway -- therefore it is pure in that language.

This comment is not intended to be an argument either way. I am just trying to clarify exactly which point of view I have been trying to argue :)