Re: Attempt to de-mystify AJAX



Tom deL wrote:
Hi Luke,

Wishing that I had seen this before but another couple of quick
comments:

<SNIP>

Oddly enough, I wasn't even talking about strong typing. For all I care,
you could declare all your variables as Variant. Just so long as you
have to declare them.

And I missed this, sorry. Dawn mentioned jslint, isn't that workable for those requirements? Virtually all modern languages have some sort of lint-like.

Ah, but how many are actually using them? I remember that lint was a standard tool back in my C days, but I sure as eggs didn't use it. Nobody I knew did. Dawn hasn't. Nor has Chandru.


Compare and contrast with Java. You don't get a choice with Java. You write code with certain classes of errors, and you'll know about it.

Hell, with Javascript, if you reference a property that doesn't exist,
you get "undefined". In a proper, disciplined environment, you wouldn't
be able to get beyond the first compilation without fixing errors like that.

Yup, agreed. Again, pros & cons.

So tell me some pros. The only pro that I know is that the stuff runs in the browser, and I still think of that as a mixed blessing.

If you need to do stuff in the browser it is sort of the only required blessing.

If you /decide/ that you need to do complex stuff in the browser, you'll be /convinced/ that you need it.


<snip>

Java will never be like Barney. Java is big and complex. I prefer
Barney, but Barney knows his place.

Agreed.

So... you know Barney? Everybody must love Barney.

<snip>

In any case, this raises another argument that I have against the
browser as a pervasive platform. You have to code stuff both in the
browser and back on the serve, in two different languages. You're pretty
well doubling the workload. And you're passing stuff back and forth in
XML, which is far from being the most efficient data representation
known to man. What's with that?

{Sigh} Seems that all of the side show side tracked the idea for the original post: de-mystifying (and debunking) the AJAX method. In that post I attempted to point out:

| A BIG note: Part of the mystification of this method seems to be the
| XML part. I don't know whether you noticed but there is NO XML code
or
| data whatsoever invloved in this example.

| The reason that XML is even part of the name is that the javaScript
| method used is XMLHttpRequest() - a method developed for XML use. We
| can use it just fine for HTML or just plain text.

In all of my use of AJAX (which includes some fair sized applications)
I have never used XML, Usually the scripts involved simply output the
text that they acquired from the database. The client-side scripts then
simply stuff that text into a formatted space in the 'html' document.
It is really very simple.

OK, so the XML argument doesn't apply. Apparently that's true of Dawn and Chandru as well. Thank the gods for that small measure of mercy.


Chandru likes javaScript and uses it for much more (data manipulation,
formatting and such) ... I am not fond of it so just use it where I
have to.

So you're not fond of it and I'm not fond of it. But we both use it when absolutely necessary. What sort of argument is this? Maybe we could spice it up if I kicked you in the nuts, but my legs aren't that long. ;^)


<snip>

And I agree with you, except that I consider "the front" to be better
done as a fat client, not on a browser. Then "the back" is just a bunch
of components that can be called either directly by the client, or
hosted on the server.

<snip>

I've seen these waves come and go. I'll ride it out. Not that I'm
ignoring the Web, by any means. Webber by name, Webber by nature, that's
me. I just like to keep it in its box, rather than letting it roam wild
and eat my roses.

And here we are probably talking apples and bowling balls. Most of my work in this area is specifically for the public web. It is simply not possible to pass our thick clients to each visitor. Even if I could (MM Flash?), just forcing people to download something chases most of them away.

Um, Tom. We have no argument. You use a bit of Javascript when and as necessary, on public websites. So do I. You don't much like Javascript, so keep it to a minimum. So do I.


If it helps to keep things lively, where I live we say "to-mar-toe" and "py-jar-mas". Let's build on that.

<snip>

But seriously, one thing has been missing from this discussion. Whatever
happened to security concerns here?


Another reason that I like to have PHP doing the bulk of the work. But
that may only be due to my having more experience there.

There's our only real difference. I'm not wildly fond of PHP, but that's probably a simple matter of taste.


Thanks for your input,

Makes you sound like Number 5. <g>

Cheers,
Luke
.