Which AJAX toolkit do you use?
Moderator: General Moderators
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
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.
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.
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?
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?
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.
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.
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.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
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.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)
Again, I will be happy to be proved wrong...
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.
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.
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.
- christian_phpbeginner
- Forum Contributor
- Posts: 136
- Joined: Sat Jun 03, 2006 2:43 pm
- Location: Java
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
All the things that you named you were doing while I was coding made me 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
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
This is just so wrongpatrikG 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.