Wednesday, August 17, 2005

JAAJAX and the state of Ajax on .Net

To flame or be civil? That is the question. :)

Ok, I'm going to try to be nice here. Jay Kimble (CodeBetter member) has posted an Ajax library. He calls it "JAAJAX" aka: Just Another AJAX.

His intentions are good enough: He hopes to start setting some best practices for Ajax usage.

Or are they?

My position is we don't need 'em ("best practices" that is). The rules of good use of Ajax are no different than anything else. He mentions Ajax Security concerns later... but the overall message is, don't deviate from what you should be doing now with regular pages. Is this really something that needs repeating? Good coders will seek out ways to improve. Bad coders can't be force-fed. Nothing new here.

Let's get down to the real problem though: His library leaves a lot to be desired. I know, harsh. I don't mean for it to reflect on anyone as a coder. In fact, JAAJAX is rather similar to Ajax.Net, which I myself thought was decent enough. So similar in fact, that you end up wondering what the point is. Beyond that though, Ajax.Net itself is a poor example of how to implement Ajax.

Why should you listen to me? Well, for one, the style of JAAJAX and Ajax.Net breaks Seperation Of Concerns. ASP.NET's half-assed idea of a "Controller" now has to discern between Ajax, and regular requests. Why should it? Plus you just end up having to write a lot more code than should really be necessary for the task.

So what's a decent Ajax Library?

*THE* Ajax Library is Prototype. SoC is maintained (well ok, you might need to add shell Actions to deliver full page layouts for non-Ajax requests, but that's a minor compromise compared to the alternatives), and the only code to write is a Javascript one-liner in your View. It makes all other libraries I've seen (especially on .Net), look like bloated, needlessly complex crap.

Plus it also provides handy Javascript classes to toy with, and it's as cross-browser friendly as they come.

When Ajax is as simple as a one-liner, what's the prob? That people have the power to write crap code? Crap code is crap code... wether it's Javascript, VBScript, c#, etc.

So what's the conclusion? If you're stuck in .Net land, what should you be using if you want to get your hands dirty with Ajax? The answer is easy: MonoRail, whose Ajax support is based on Prototype. Once you write an application in MonoRail you'll never want to go back to regular ASP.NET. Just don't look at Ruby On Rails. As I read on another blog: If you haven't by this point, then don't. It may lead to depression, despair, etc when you realize you've been writing two or three times as much code as you needed to get the job done, and Rails makes anything else look like spaghetti code no matter how clean it is. :D
Comments:
Whoa! Dood! I get paid to to ASP.NET development for a living. Way BEFORE discovering RoR I realized that ASP.NET is a hunk of ill-conceived [bad word omitted]!

Unfortunately, the MS developer world is composed mostly of sheep. Making the Web work like VB is a bad thing(TM).
 
Do you have a link for MonoRail? Unfortunately, Googling for "monorail" is not very productive.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?