Go to the homepage. Skip navigation and go to the content of this page.

Digital Worlds, thoughts and portfolio of Johan Arensman

April 22 2008

Why Prototype?

Couple of weeks ago a collegue asked me: "Why Prototype?".

The answer? I don't know. I can't say I've worked with every single Javascript framework there is and really I couldn't care less about framework X doing activity Y better than Prototype.

So? Why stick with it? Because I like the way it's documented and I like the way the developers of Prototype try to make code readable. Readabillity is crucial these days. Ever tried learning a new language? Well I'm recently hired as a developer at Green Valley, and so far I've only developed websites using PHP. Green Valley uses JSP which means I have to learn JSP to be able to actually keep the job more than one month.

I haven't done that much but I have been checking out some code samples on the web and I have to say that the average JSP developer likes to use varables with very VERY short names. Let's store our title in public string T; or maybe we should store the template name of a footer in a variable named 't_F'? Makes reading so much easier...... Yes that was sarcasm.

I'm sorry but when you have to read a script that tries to parse 't_B' which has to include 'tC' (no I didn't forget the _, it simply wasn't there) and also contains a list of 'SMitms', of which I think it means Submenu items you get lost quite easily.

That's why I like Prototype. It makes scripts readable! Which makes it easy to explain stuff to developers who haven't worked that much with Javascript. Especially the way you can chain several methods on a single element like this:

element.wrap('p').update('hide me!').down('p').hide();

This makes stuff readable and enables people to understand the language a lot faster than trying to hide as much code as you can by using ridiculously short variables or method names.

Ye, Ye, Ye, Mootools uses a lot of the same methods etc.. bla bla bla. I really couldn't care less because Mootools is EVERYTHING! It comes with effects (i know you can strip em out) and all sorts of other crap. I want a frameworks that supports MY code and I don't want to write code that supports some framework. If I want effects I'll use script.aculo.us which is something written on a framework instead of being a framework itself.

Enough yelling for now and if you will excuse me I have some JSP to decode.

 

Digg Submit

Comments

Feel free to add your comment to the discussion.
Your post will be validated first because of the huge amounts of spam posts.

All fields are required and must be valid.
Your E-mail address will be linked to the Gravatar system so create your avatar there now!
The 'Remember my details' checkbox stores your name and e-mail in a cookie on your computer. It is advised not to use this feature on a public computer.

Weblog categories