Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is jQuery considered a language?

Tags:

jquery

I was just wondering 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.

like image 865
drexsien Avatar asked Nov 17 '10 06:11

drexsien


3 Answers

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.

like image 77
Christian C. Salvadó Avatar answered Nov 01 '22 03:11

Christian C. Salvadó


It's a javascript library. So i'd say no. Javascript is the language.

like image 42
Abe Miessler Avatar answered Nov 01 '22 03:11

Abe Miessler


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.

like image 5
Matthew Flaschen Avatar answered Nov 01 '22 03:11

Matthew Flaschen