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?
I would suspect the methodology to be: make it as small and as fast as possible.
They use the functional programming paradigm.
It's tiny, it's straightforward, and it's fast.
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.
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/
精彩评论