Web Info & Tutorials

January 4th, 2007

JSON VS. XML: THE DEBATE

The big debate over the winter holidays seems to be people shouting about JSON vs. XML.

Dare Obasanjo has a nice round-up, as well as his own opinions on the matter:

In the past two weeks, I’ve seen three different posts from various XML heavy hitters committing this very sin

  1. JSON and XML by Tim Bray - This kicked it off and starts off by firing some easily refutable allegations about the extensibility and unicode capabilities of JSON as a general data transfer format.
  2. Tim Bray on JSON and XML by Don Box - Refutes the allegations by Tim Bray above but still misses the point.
  3. All markup ends up looking like XML by David Megginson - argues that XML is just like JSON except with the former we use angle brackets and in the latter we use curly braces + square brackets. Thus they are “Turing” equivalent. Academically interesting but not terribly useful information if you are a Web developer trying to get things done.

This is my plea to you, if you are an XML guru and you aren’t sure why JSON seems to have come out of nowhere to threaten your precious XML, go read JSON vs. XML: Browser Security Model and JSON vs. XML: Browser Programming Models then let’s have the discussion.

If you’re too busy to read them, here’s the executive summary. JSON is a better fit for Web services that power Web mashups and AJAX widgets due to the fact that it is essentially serialized Javascript objects which makes it fit better client side scripting which is primarily done in Javascript. That’s it. XML will never fit the bill as well for these scenarios without changes to the existing browser ecosystem which I doubt are forthcoming anytime soon.

Next up: CSV vs. Fixed Width Documents.

Update: Dare’s round-up missed the real instigator of the JSON vs. XML meme: Dave Winer’s blog (here and here). Fun quotes, like this one from Dave:

As Dr Phil asks — What were they thinking?

No doubt I can write a routine to parse this, but look at how deep they went to re-invent, XML itself wasn’t good enough for them, for some reason (I’d love to hear the reason). Who did this [JSON] travesty? Let’s find a tree and string them up. Now.

And Douglas Crockford’s (JSON guy) reply:

I liked the part where Dr Phil said “What were they thinking?” I asked the same question when I first saw XML being proposed as a data format. There were obviously better alternatives.

The good thing about reinventing the wheel is that you can get a round one.

Don’t miss the two different comment threads as well, here and here. Fun times ahead as web service and Web Service APIs continue to collide. - Ben

January 4th, 2007

AJAX BOOKMARKING SYSTEM

Stew Houston has created an Ajax bookmarking system using PHP.

He has written up his experience building the system and includes a simple demo

January 4th, 2007

FOOPLOT: FUNCTION PLOTTING

Dheera Venkatraman has free Fooplot, a newborn website that plots some function, and supports Google Maps-style panning around.

Fooplot is currently using SVG and VML to do the performance and sheet hold is reaching for Safari.

For beatific SVG browsers same Firefox and Opera, 3D plots impact too.

In the future, it module transmit with Google spreadsheets and interact with server-side scripts that do flex run and another tasks.

Fooplot

January 4th, 2007

DISHOLA: WEB 2.0 RESTAURANT GUIDE

Dishola is a new site that aims to be the Web 2.0 restaurant guide.

The site was built with CakePHP (v1.2) and is unobtrusively decorated w/ Ajax thanks to addDOMLoadEvent and Cake’s RequestHandler component (for instance, if you’re logged in and click on the “Add to My Future Feasts” link before the DOM has loaded, the href works as expected, but most likely you’ll get the inline ajax experience).

If you register and “Add a Dish” you’ll see that we’re using Yahoo’s Local Search API to match up the restaurant to something already in their db (thus ensuring geocodes, data normalization, and a yahoo_id with which to link into reviews, and most importantly it saves the user the tedium of finding this stuff and cutting and pasting) And if the restaurant say isn’t in Yahoo Local yet, the entered address gets geocoded via Google. I think this is probably the neatest feature on the site so far.

Dishola

January 4th, 2007

30 BOXES UPDATES PUBLIC VIEW

30 boxes has always given you the ability to show your public events from a calendar, but it was a primitive list.

Now, a rich calendar view is shown so any scary person on the internet can stalk you via a nice experience.

30 Boxes