It seems to me that jQuery doesn't seem to be written as an OOP framework, it seems too short, and not verbose enough for that. Am I right in thinking this and if it isn't written as OOP, then what methodology/paradigm are they using?
+8
A:
I would suspect the methodology to be: make it as small and as fast as possible.
Diodeus
2010-04-28 14:09:19
...and yet modularized. Sure, not in a very OOP-way, but mainly because JavaScript is not object oriented.
Felix
2010-04-28 14:11:54
@Felix, I would say javascript is object oriented. But it depends a little bit of how you define oo.
Mattias Jakobsson
2010-04-28 14:24:40
JavaScript is object oriented language... but it's prototype based OO, not class based OO.
Crozin
2010-04-28 14:56:47
Hmm, I remember reading somewhere JavaScript was not OO. However, it seems Wikipedia says it's OO. Oh well, terminologies *sigh*
Felix
2010-04-28 18:12:14
+2
A:
No, jquery isn't written to be a oo framework. It is all about abstracting the dom and ajax. Here is a great article about the differences between jquery and mootools: http://jqueryvsmootools.com/
Mattias Jakobsson
2010-04-28 14:13:13
+3
A:
They use the functional programming paradigm.
It's tiny, it's straightforward, and it's fast.
Dean J
2010-04-28 14:32:50
jQuery often relies on state and mutable data, which is contrary to most definitions of functional programming.
Greg
2010-04-28 15:52:20
+2
A:
jQuery behaves like a monad. Monads are usually used in functional programming langauges such as Haskell, but are not limited to them. See http://importantshock.wordpress.com/2009/01/18/jquery-is-a-monad/
I'm reluctant to say jQuery uses the functional programming paradigm because it is very stateful, which functional programs try to avoid.
CiscoIPPhone
2010-04-28 15:36:30