Categories
JavaScript

Prototype is not the de facto standard

Recovered from the Wayback Machine.

Ajaxian has a pushback at Prototype criticism. Among the criticism is:

A lot of javascript tutorials written today are based on the prototype framework. So, I thought it would be nice to see how other people use prototype.js . What I found is that the majority of people use it only because they think it is easier when in fact, they use only a couple of prototype functions ($() and the AJAX functions primarily).

This is a good point. If you’re only using Prototype to access a page element or make an Ajaxian server-side call, you’re not using Prototype to the fullest, and you’re better using your own homegrown.

I agree with Ajaxian, though, in that there is documentation on Prototype, though the creator of the library seems to be reluctant to make this known. Where I don’t agree with the writer, Rob, is his statement:

…although I’m disappointed to see that Sergio hasn’t updated his excellent reference since May, there are still so many fantastic howto’s and tutorials written using Prototype. Plus the books out now that base much of their code on Prototype.

Nope. My book, Adding Ajax, doesn’t. Covers it, yes, but also covers other libraries, too. More importantly, I create original JavaScript for all my examples so that a person can ‘see’ what’s happening without having to dig through the cryptic Ajax libraries, or without having to take a ‘leap of faith’. Then I demonstrate the examples using one library or another, Prototype among them, so the reader can learn how to use these, as well as write their own code–or do both. I don’t think a book author is doing the readers a service by making them dependent on one library that could go *poof* if the developer got bored with maintaining it. Yes, even a widespread use library like Prototype that’s open source.

I also dig into the libraries, exploring the code, and that includes Prototype because it does have some very clever implementations and nice use of JS. Still, I don’t just write “we’ll use Prototype for this” without explaining why. I don’t know of a lot of other Ajax books that are completely dependent on Prototype, either. Too much is changing in this environment to make folks dependent on one library or another.

I respect Prototype much more than I originally did when I first started using it. However, I still think that $() is confusing to new JavaScript developers, though it’s too widespread now to change. I also don’t fully understand why there isn’t a link to some form of documentation with the library.

Categories
JavaScript

Ooo, Ouch!

M David Peterson points out a comment by Aristotle Pagaltzis over at the Ongoing post on the JSON/XML thing:

From: Aristotle Pagaltzis (Dec 21 2006, at 18:52)

Anders:

It’s a stretch to call the man who designed both RSS 2.0 and OPML an “XML partisan.”

Toro! Toro! Olé!

Categories
JavaScript

Tightening the data

Recovered from the Wayback Machine.

Dare Obasanjo and I don’t always agree, but today I agree with him completely when he writes about the tightening of data from web services:

The obvious reaction was to make the Google and del.icio.us announcements into a REST vs. SOAP or XML vs. JSON story since geeks like to turn every business decision into a technology decision. However if you scratch the surface, the one thing that is slowly becoming clear is that providers of data services would rather provide you their data in ways they can explicitly monetize (e.g. driving traffic to their social bookmarking site or showing their search ads) instead of letting you drain their resources for free no matter how much geek cred it gets them in the blogosphere.

The two changes are Google’s closing the SOAP API in favor of a client-based Ajax service, and de.licio.us announcing an Ajax Widget. I participated some at a thread over at Dave Winer’s on this one, and created a simple example pulling the delicious tags for this site, but I think the Google change is the more important one.

I believe we’ll see more web services being pushed to the client in 2007. Fortunately, this opens up a great deal of new functionality to all people, including those using Blogger or other hosted tool.

Unfortunately, we’re going to see it get progressively more difficult to load web pages, with all of the widgets being embedded into the sidebar, such as this absolutely essential one. Good thing we have syndication feeds–might be the only way we’ll be able to read pages in a couple of months.

Categories
JavaScript

Same under the skin

The Web Standards Project points to a post, Dear JavaScript Library Developers by Chris Heilmann, which makes some excellent points about the difficulties in using today’s JS libraries.

In particular, I want to point out Chris’ last point:

Don’t play the “mine is smaller than yours” card. It gives the wrong impression to new developers as they might be tempted to think that your short wrapper methods are all that has to get executed. We all know that they have to be converted to native JavaScript and DOM methods before execution.

This is a key item, because many of the new ‘Ajax’ libraries are focused more on making JavaScript look and act like Ruby or Python, than necessarily packaging functionality into easier to use units. Many of the libraries, in fact, are more difficult for new JavaScript developers to work with than raw JavaScript.

There’s an interest in making JS development more robust; to add in new discipline; to bring in the concepts contrived in the ‘real’ languages. What happens, though, is that you may end up actually processing more JavaScript just to get these ‘rigorous’ enhancements, than if you just use simple JS.

Not to say the libraries aren’t good, just that the more we get caught up on the mechanics, the more cryptic our offerings, the more inward looking our results, the less universally useful the end result will be.

Ultimately, all of these libraries convert to native JavaScript and DOM methods before execution. This is the scripting equivalent to we all put our pants on, one leg at a time.

Categories
JavaScript

Peeved at Firebug

I’m really peeved at the Firebug folks.

Here I thought I was finished with the first chapter of “Adding Ajax”. Now I have to edit it to include a section that starts with, Before we jump into how to add Ajax effects to your pages, you’ll need to download Firefox and install both it and Firebug.

In my almost 25 years of being in this industry, Firebug has come closest to being a perfect implementation of a specific functionality.