[UPHPU] Ajax frameworks
Joseph Scott
joseph at josephscott.org
Wed Mar 11 09:28:20 MDT 2009
On Mar 11, 2009, at 8:12 AM, Scott Hill wrote:
> I recently completed a small ajax application and thoroughly enjoyed
> learning more about ajax. Now that it is complete and in
> production, it is
> being suggested that I should have used a framework. "They" were
> also quite
> chagrined that I got away with using php for the project. (It's
> those .net
> people again)
>
> So, why should I use an ajax framework instead of doing the ajax
> coding
> myself? What are the benefits. The down side?
As far as the Javascript part goes, probably looking for more of a
library than a framework.
My JS library of choice right now is jQuery, and the reason I'd use
that over rolling my own XHR wrapper is mostly maintenance.
Supporting a large range of browsers can be painful, having that
effort more centrally focused (many people contributing to a library
versus only me writing a new one) helps get better coverage.
Optimizations going forward, so when a new browser (or new version of
a browser) adds some additional feature or changes implementation I
can benefit from the work done in the library. That sounds like a
contrived situation, but it's already happened in IE. As we see
things like JSON and cross domain XHR moving forward in the future I
think we'll see more situations like that.
In the jQuery case there's also features that I find useful, that I
probably wouldn't haven't implemented myself, like JSONP support.
Performance is another area that could potentially go either way. You
could certainly make a smaller library by only including the bits you
need, but it isn't always clear that it would execute faster,
especially across all browsers.
It really doesn't matter at what level we are talking about (lower
level like C, or high level like Javascript) the library discussion is
pretty much the same. It's a series of trade offs and you need decide
which set of trade offs you want to deal with.
--
Joseph Scott
joseph at josephscott.org
http://josephscott.org/
More information about the UPHPU
mailing list