Is jQuery considered a language?
I was just won开发者_JAVA百科dering if jQuery can be considered as a language, since it has its own syntax. I can't say it's a library, because most other languages are made through a library of another language. For example, PHP is written in C and PHP functions call functions made in C.
Just wanted to hear ideas and insights from all of you.
It doesn't have its own syntax, it's simply plain JavaScript.
They implement a fluent interface pattern, that basically allows you to chain function calls, e.g.:
$(argument).method1().method2(); // etc...
$
is allowed to be used as an Identifier, that's why many libraries use it, not just jQuery.
In the above example, the $
identifier is in the context of a call expression, $(arguments)
is just similar to myFunction(argument)
, that function call returns an object, that contains other properties that are by itself methods, that can be called subsequently as a "chain".
An example of a language built on top JavaScript (something slightly similar to your C => PHP example) would be CoffeeScript.
It's a javascript library. So i'd say no. Javascript is the language.
No, jQuery is a JavaScript library. It doesn't have its own syntax, but rather (as Jason said) a set of conventions for using JavaScript syntax.
PHP is a language with a runtime written in C. PHP code is obviously not C code.
I guess you will need interpreter to call something a language. jQuery doesn't have any special interpreter... its using JS's
jQuery, MooTools, Dojo, Prototype and other libraries can't considered as a language. But one can know how to use jQuery well and don't know how to use JavaScript properly.
It doesn't have its own syntax. It exposes its own methods and properties. Just like anything else you can write in JavaScript.
jQuery really doesn't have its own syntax - it uses the JavaScript syntax and language. So technically, no. However, it can drastically change the way you use JavaScript to work with HTML elements using client-side scripting, so it almost seems like its own language.
jQuery is basically a javascript having some user-friendly ways to use javascript with third party controls already made on it. These controls are generic functionality needed in common development. It has great support with great user interface. so in 4 or 5 steps you can integrate controls in your application.
http://jquery.com/ is a official site which has all you questions answered.
There is one know issue related to it is that jQuery many times conflict with Prototype.js (basic javascript file). User have to handle this conflict with a couple of line of code.
Isnt it a case of Minilanguaje?
The domain-specific little language is an extremely powerful design idea. It allows you to define your own higher-level language to specify the appropriate methods, rules, and algorithms for the task at hand, reducing global complexity relative to a design that uses hardwired lower-level code for the same ends. You can get to a minilanguage design in at least three ways, two of them good and one of them dangerous.1
In my thought, it is a language one level up from pure javascript whenever it is not a precompiled nor interpreted language.
精彩评论