Which AJAX toolkit do you use?

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

Which AJAX toolkit do you use?

prototype
24
34%
script.aculo.us
7
10%
JSON
4
6%
dojo
7
10%
yui
2
3%
moo.fx
8
11%
ASK - AJAX Source Kit
1
1%
XOAD
1
1%
JQuery
12
17%
AJAX Agent
1
1%
xajax
4
6%
 
Total votes: 71

User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

i am not into ajax,it's to much hard work only to provide a fancy little thiing, i only used it once in a very basic way...

anyway... tinyajax was the only one i could use, as it was the simplest.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

xajax, prototype (and scriptaculous/moo.fx).

Usually the company I keep. Similar reasons to patrikG - simplicity. The torrent of AJAX options is great, but sometimes you really only need a lean, mean option whose API is a breeze to use. Prototype and usually moo.fx I have used in the past for much heavier eye candy.

I once did some playing with HTML_AJAX (PEAR) and it's something I'll be looking up again to see what progress has been made over the past three months or so.
freefall
Forum Commoner
Posts: 48
Joined: Sun Jun 18, 2006 3:55 am

Post by freefall »

Why the need to use a toolkit?

Just write your own...it only needs about 10 lines and done. Ajax is so typical of the net, something that simplifies being turned into something you need a diploma in wtf to understand.

Could you explain what the benifits of using a toolkit are vs the 10 lines max required?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Three reasons:

1) I'm lazy (i.e. time is precious, hence make efficient use of it, aka "Why re-invent the wheel?")
2) Character Encoding
3) When started from scratch, any project (AJAX toolkit or whatver) will take time & effort to reach maturity (see reason 1)
freefall
Forum Commoner
Posts: 48
Joined: Sun Jun 18, 2006 3:55 am

Post by freefall »

This is what confuses me. This is how I use the httprequest:

I create the xmlhttprequest object
I make a request
I get the response
I do something with it


Which bit needs a "toolkit"?

creating the object is what 2 lines?
making the request is what, another 2 lines?

I guess what I'm asking is what exactly am I missing here because apparantly I have to be missing something.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

well... toolkits provide a lot of other cool stuff as well... I have just started on AJAX, and so far I've only used what I learned from Rasmus' 30-second AJAX tutorial, but eventually I will be using scriptaculous as well... not so much for ajax (actually i didnt even know it was an ajax toolkit... I thought it was a dhtml toolkit) but for animation/drag & drop/etc.
freefall
Forum Commoner
Posts: 48
Joined: Sun Jun 18, 2006 3:55 am

Post by freefall »

yeah that was gonna be abother question. I know "scriptaculous" and only a tiny fraction of it has anything to do with ajax.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

patrikG wrote:Three reasons:

1) I'm lazy (i.e. time is precious, hence make efficient use of it, aka "Why re-invent the wheel?")
2) Character Encoding
3) When started from scratch, any project (AJAX toolkit or whatver) will take time & effort to reach maturity (see reason 1)
I seriously gun for speed in the matters of Professional sites with AJAX... hence the preference for AJAX code that is atleast tightly integrated into my PHP code. I can match them professional toolkits with my code for matters of speed and I bet my one will win hands-down :p.

Again, I will be happy to be proved wrong...
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Some years back there was a some discussion about db-wrappers which is quite similar to the discussion about AJAX-toolkits. Do you use database-wrappers? If so, why?

If not, the only reason that stands up to serious scrutiny for your position will be performance: "much faster without". Is it really? Ah, yes, it is indeed. PHP's precompiled MySQL-commands are faster than a db-wrapper. What have you gained by that? A few CPU-cycles.

What have you not gained? An API. In short: abstraction. You have to code every instance of every XMLHttpRequest individually, have to parse it, have to do all the nasty "is it IE, is it FF" stuff, have to write 15 lines of code (which are a bit faster) rather than 1. Why? To gain 5% speed increase? I throw a Gig of RAM at my server for £60 or so which makes up for that. And instead of spending 5 extra hours on coding something, I can sit down, read a book, drink some tea and tell my girl that she's the sweetest woman on earth and she will look at me and smile.

"Ah", you say, but I have created my own library. "Cool", I say: you've started creating your own API. Before it reaches a level of maturity that matches that of the library I'm using, it'll be some time for at the moment, it only caters for the needs you have at this point in time. If your requirements change at any time, you will have to extend your set of functions/classes, possibly re-think the whole thing a bit. Another 20 hours down the line before you're happy. In that time, I've finished my book, cooked a wonderful dinner for my girl, watched a DVD, slept a good night's sleep and went for a ride on my mountain bike. Now: you discover a bug in your AJAX class. Nothing serious, but it has to do with some UTF-8 issues which PHP 4 doesn't quite handle too well (and since your hosting company only supports PHP4, you have to deal with it). Once you've solved that, you start loosing sleep over some security-concerns. In that time, I have come home after a wonderful bike-ride with my girl, she cooked lunch for me and so on and so on.

You catch my drift? Not only have you missed out on the benefits of abstraction, you have also missed out on the golden rule of "How Many Eyeballs Tame Complexity", on the many benefits the OS-community offers. If someone has started some good work, and the OS-community has actually contributed to a degree that the whole shebang turned into a solid, mature library with the goal of minimizing the work I have to do: I use it. I'm lazy and I don't like to re-invent the wheel.

P.S.: Speed alone is not necessarily professional. Hardware is dirt-cheap and will only get faster and cheaper. Developer's won't. It's how well your project is planned, whether you managed to stay within budget, whether your time-estimates were realistic etc. etc.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I'm lazy too... very lazy. So I use a lot of libraries. The cool thing is that if you are a good programmer, you can build an application in such a manner that it can use a library until you have the time to implement whatever functionality it provides, at which time it will be an easy switch. That's what I try to do. Like right now I'm using adodb for a project I'm working on, but I've implemented it in such a fashion that I can present it to the client and beat the deadline, but then come back later and implement my own db wrapper system... which will be quite a bit faster.
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

I voted for prototype, because I am learning how to use it now. But really, if I have more time, I would have learnt to use prototype so I can create my own class.

As for normal work days, I usually use scriptaculous and openrico.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

pwned!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

n00b Saibot wrote:pwned!
?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

All the things that you named you were doing while I was coding made me cry :cry:

But seriously it didn't take me more than 10-12 minutes to throw it together... and that includes 2 bug fixes & tests for security...
i would call it a lib.. just implementation of the technology... lib is generic.. implementation specific.

I generally decide on what is best for a particular case... In most cases my own existing libs take care of all needs I ever do have in all aspects of web programming... and as it happens (and maybe it is wrong) that I code around these libs... into which my custom AJAX implement fits rather beautifully... so that's my case.

comments/suggestions/arguments are welcome :)
freefall
Forum Commoner
Posts: 48
Joined: Sun Jun 18, 2006 3:55 am

Post by freefall »

patrikG wrote:Some years back there was a some discussion about db-wrappers which is quite similar to the discussion about AJAX-toolkits. Do you use database-wrappers? If so, why?

If not, the only reason that stands up to serious scrutiny for your position will be performance: "much faster without". Is it really? Ah, yes, it is indeed. PHP's precompiled MySQL-commands are faster than a db-wrapper. What have you gained by that? A few CPU-cycles.

What have you not gained? An API. In short: abstraction. You have to code every instance of every XMLHttpRequest individually, have to parse it, have to do all the nasty "is it IE, is it FF" stuff, have to write 15 lines of code (which are a bit faster) rather than 1. Why? To gain 5% speed increase? I throw a Gig of RAM at my server for £60 or so which makes up for that. And instead of spending 5 extra hours on coding something, I can sit down, read a book, drink some tea and tell my girl that she's the sweetest woman on earth and she will look at me and smile.

"Ah", you say, but I have created my own library. "Cool", I say: you've started creating your own API. Before it reaches a level of maturity that matches that of the library I'm using, it'll be some time for at the moment, it only caters for the needs you have at this point in time. If your requirements change at any time, you will have to extend your set of functions/classes, possibly re-think the whole thing a bit. Another 20 hours down the line before you're happy. In that time, I've finished my book, cooked a wonderful dinner for my girl, watched a DVD, slept a good night's sleep and went for a ride on my mountain bike. Now: you discover a bug in your AJAX class. Nothing serious, but it has to do with some UTF-8 issues which PHP 4 doesn't quite handle too well (and since your hosting company only supports PHP4, you have to deal with it). Once you've solved that, you start loosing sleep over some security-concerns. In that time, I have come home after a wonderful bike-ride with my girl, she cooked lunch for me and so on and so on.

You catch my drift? Not only have you missed out on the benefits of abstraction, you have also missed out on the golden rule of "How Many Eyeballs Tame Complexity", on the many benefits the OS-community offers. If someone has started some good work, and the OS-community has actually contributed to a degree that the whole shebang turned into a solid, mature library with the goal of minimizing the work I have to do: I use it. I'm lazy and I don't like to re-invent the wheel.

P.S.: Speed alone is not necessarily professional. Hardware is dirt-cheap and will only get faster and cheaper. Developer's won't. It's how well your project is planned, whether you managed to stay within budget, whether your time-estimates were realistic etc. etc.
This is just so wrong :D
Post Reply