Why prototype?
Moderator: General Moderators
Why prototype?
Why do people even use Prototype's API if there's jQuery? Is it ignorance? Do people even know about jQuery, and it's simplicity and power?
So why Prototype, or any other API for that matter?
What's missing in jQuery that it's not the most popular?
PS: I was really trying to get at this in my last client side post, which I deleted.
So why Prototype, or any other API for that matter?
What's missing in jQuery that it's not the most popular?
PS: I was really trying to get at this in my last client side post, which I deleted.
Also, some people are used to working with the DOM. Prototype provides the user a way to work with the DOM the way they are used to working with it, only with shortcuts and easier access to the things they use most often. jQuery is a total abstraction of the DOM. You don't need to know about all the inner-workings of it. For me, this is good, because at this point, I'm just not interested in messing with all of that.
I'm having a little bit of a hard time working out which one I want to use.
jQuery is the only one I've used. The only problem I'm having is with the Interface extension. The Demo's easing effects don't work on any of my browsers: Firefox, IE, Opera or Safari.
Will they work when I download it?
jQuery is the only one I've used. The only problem I'm having is with the Interface extension. The Demo's easing effects don't work on any of my browsers: Firefox, IE, Opera or Safari.
Will they work when I download it?
-
the_drizzle
- Forum Newbie
- Posts: 17
- Joined: Fri Jun 01, 2007 11:55 am
jQuery is a godsend! Technically it's preference, but even more technically, you should just use jQuery. Can you tell my favourite? 
Also check out Interface. If you like GUI, then you should like Interface, which runs on top of jQuery. The obvious contender is Scriptaculous but I find Interface is a larger library and it's easier to use.
But yeah. It's completely up to you.
-----------
Edit
-----------
Sorry, you already knew about interface.... Oops.
Also check out Interface. If you like GUI, then you should like Interface, which runs on top of jQuery. The obvious contender is Scriptaculous but I find Interface is a larger library and it's easier to use.
But yeah. It's completely up to you.
-----------
Edit
-----------
Sorry, you already knew about interface.... Oops.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
You could also look at the extjs which can also use jquery.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Here's what I've found: jQuery is a bit lacking when it comes to OOP-emulation features that Prototype is quite famous for (it's not called prototype for nothing). While one may argue that OOP is not the paradigm one should follow when coding in such a flexible language like JavaScript, it has certainly been frustrating trying to implement polymorphism and base classes in jQuery.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I hadn't seen Interface before -- pretty cool for javascript.
http://interface.eyecon.ro/demos/carousel.html
http://interface.eyecon.ro/demos/carousel.html
(#10850)
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
-
the_drizzle
- Forum Newbie
- Posts: 17
- Joined: Fri Jun 01, 2007 11:55 am
Oh yeah. I really agree that there are differences between jQuery and Prototype. They are not to be confused with two different 'products' designed with the same purpose.Ambush Commander wrote:Here's what I've found: jQuery is a bit lacking when it comes to OOP-emulation features that Prototype is quite famous for (it's not called prototype for nothing). While one may argue that OOP is not the paradigm one should follow when coding in such a flexible language like JavaScript, it has certainly been frustrating trying to implement polymorphism and base classes in jQuery.
It's funny, JavaScript is probably one of the most OO languages around. It's more object oriented than Java. It's just that no one ever really talks about JavaScript's OO side because the context is usually web UI. And I'd definitely say that an OO approach with JavaScript is a great way to go.
As for polymorphism and the like, I think jQuery should - or is supposed to - be used as a library or as a DOM manipulation framework. Prototype is a little bit different in that it strives to be an entire client-side framework. jQuery is to pieces of the PECL as prototype is to the Zend Framework or CakePHP. Personally, assuming I'm going OO in JavaScript, I'd build OO framework that uses jQuery, avoiding integration madness.
But then again, my thoughts may have been invaded by bias.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Well, they do call themselves a "library" and specifically makes accomodations for other libraries. That being said, I don't want to use both Prototype and jQuery and have DOM/Events/AJAX code all duplicated.
Javascript doesn't natively support OO constructs, so I wouldn't call it an OOP language per-say, but its objects are so flexible that you can implement all of them with ease.
Javascript doesn't natively support OO constructs, so I wouldn't call it an OOP language per-say, but its objects are so flexible that you can implement all of them with ease.
-
the_drizzle
- Forum Newbie
- Posts: 17
- Joined: Fri Jun 01, 2007 11:55 am
Oh, you'd certainly not want to use them together. I was suggesting using jQuery and then writing something else - like Prototype - to use it. You could even harvest from Prototype if you're risqu'e.Ambush Commander wrote:Well, they do call themselves a "library" and specifically makes accomodations for other libraries. That being said, I don't want to use both Prototype and jQuery and have DOM/Events/AJAX code all duplicated.
Really sorry about this. Looks like I'm about to rantAmbush Commander wrote: Javascript doesn't natively support OO constructs, so I wouldn't call it an OOP language per-say, but its objects are so flexible that you can implement all of them with ease.
JavaScript doesn't natively support Java's OO constructs. Mainstream OOP languages such as Java and C++ are not the definition of OOP but rather a demonstration. A couple of things to consider: it's really easy to make lots of money in software development, we are in the middle of a globalization revolution, and theoretical computer science is still an incredibly young subject. These issues create a pattern of bandwagon hopping and the world ends up with tons of Architecture Astronauts and too much hype about nothing. JavaScript supports all the OO Java does and more, just with a different syntax. You might even call the OO capacity of JavaScript a superset of the OO capacity of Java. The real difference is that most OO structure in Java is defined statically, but with JavaScript, it's defined statically and dynamically. Nearly everything in Java is an object. In JavaScript, nearly everything is an object, including functions. JavaScript doesn't even technically have functions. It simulates functions by cleverly using objects and constructors. How much more OO can you get?