The Artima Developer Community
Sponsored Link

Weblogs Forum
The Two Roads to Ajax

26 replies on 2 pages. Most recent reply: Sep 1, 2006 4:31 AM by Manish Jethani

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 26 replies on 2 pages [ « | 1 2 ]
Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: The Two Roads to Ajax Posted: Aug 22, 2006 3:59 AM
Reply to this message Reply
Advertisement
The semantics of Javascript are much better than Java's. Dynamic typing = good, closures = good, etc. Javascript has changed, it's much better now.

Static typing is good, Java is getting closures. And Javascript being much better isn't the issue. Flash doesn't even use the Javascript that is in browsers.

The only problem is the standard library.

Actually, the problem is that Javascript is for all intents and purposes, limited to the browser. The reason I brought up compiling Java to Flash 9 bytecode is because Actionscript is a niche language like Javascript. Why do you think GWT was made?

Jules Jacobs

Posts: 119
Nickname: jules2
Registered: Mar, 2006

Re: The Two Roads to Ajax Posted: Aug 22, 2006 4:51 AM
Reply to this message Reply
> The semantics of Javascript are much better than
> Java's. Dynamic typing = good, closures = good, etc.
> Javascript has changed, it's much better now.

>
> Static typing is good, Java is getting closures. And
> Javascript being much better isn't the issue. Flash
> doesn't even use the Javascript that is in browsers.

It's ecmascript, and the semantics are mostly the same. In the closure proposal for Java there aren't even code examples of real closures.

> The only problem is the standard library.
>
> Actually, the problem is that Javascript is for all
> intents and purposes, limited to the browser. The reason
> I brought up compiling Java to Flash 9 bytecode is because
> Actionscript is a niche language like Javascript. Why do
> you think GWT was made?

It isn't limited to the brower, it's a language, and there are server-side implementations of it. GWT was made because (Java) programmers are afraid of Javascript? Javascript has a lot of scary features (like closures) that don't seem to be useful at all to someone who hasn't used them.

You may like Java better than Javascript, a lot of people think that Javascript is an inferior language. I think that programming Javascript with a library like Prototype is fun.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: The Two Roads to Ajax Posted: Aug 22, 2006 8:20 AM
Reply to this message Reply
> > C/S was never intended (because its designers knew
> > better),to be used in compute sparse, database business
> > environments.
> >
> > The Idea that data integrity should be done on the
> client
> > is a hard lesson, frequently learned. It looks like
> > another generation will do so. sigh.
>
> Are you suggesting that ensuring data integrity on the
> client is a plus?

absolutely, positively NO. that's the hard lesson.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: The Two Roads to Ajax Posted: Aug 22, 2006 9:00 AM
Reply to this message Reply
> > I got the suggestion from this article that someone
> might
> > want to write business logic and run it on the
> > client-side. This seems like a bad idea to me.
> Depending
> > on your environment, that could be a a big security
> hole.
>
> Why would that be a security hole? The client already has
> everything it needs to cause changes to the server-side
> state, even if only the thinnest display layer is
> entrusted to the client.

Not all state changes are equal. Ordering 10000 laptops at $0.01 each is not the kind of state change most businesses like clients to make, for example. If you put the all the logic on the client (and do not check it on the server) you have no control.

nes

Posts: 137
Nickname: nn
Registered: Jul, 2004

Re: The Two Roads to Ajax Posted: Aug 22, 2006 4:03 PM
Reply to this message Reply
> While JavaScript is still a hard language to develop
> business logic in, a new version, EcmaScript 4, promises a
> fully object-oriented language not unlike Java, and
> because it's fairly standardized, browser implementations
> will in time converge on fairly compatible
> implementations. In addition, client libraries already
> mask most of the browser incompatibilities. </p>

Are there nowadays any good tools to develop JavaScript, like some lint tool that checks your code or at the very least something that checks for syntax errors? When I was trying to debug something on IE and Netscape some years ago it was a royal pain. The libraries were not compatible, browsers would silently ignore errors and you would get all kind of bugs with no idea why.

Jules Jacobs

Posts: 119
Nickname: jules2
Registered: Mar, 2006

Re: The Two Roads to Ajax Posted: Aug 22, 2006 4:29 PM
Reply to this message Reply
http://www.javascriptlint.com/

FireBug (for firefox) is very good too, and lets you test your scripts in "real-time".

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: The Two Roads to Ajax Posted: Aug 23, 2006 5:42 AM
Reply to this message Reply
> It's ecmascript, and the semantics are mostly the same.

But it's not the same.

> In the closure proposal for Java there aren't even code
> examples of real closures.
>

Yeah, and your point is?


> It isn't limited to the brower, it's a language, and there
> are server-side implementations of it.

It doesn't have to be limited to anything. It's primarily used in the browser.


>GWT was made because (Java) programmers are afraid of Javascript?

I don't think anybody is "afraid" of Javascript. More likely is that people don't like switching languages, and to give developers a toolkit that feels like traditional thick clients.


> Javascript has a lot of scary features (like closures)
> that don't seem to be useful at all to someone who hasn't
> used them.
>

Haskell has a lot of scary features for someone that hasn't used them.

> You may like Java better than Javascript, a lot of people
> think that Javascript is an inferior language.

I wouldn't put either in my list of favorites.


>I think that programming Javascript with a library like Prototype
> is fun.

Great, but doesn't really have anything to do with my point - which was that if the flash 9 VM has the chops to handle a subset of Java, then that would only expand developer interest in the platform.

We'll wait for WPF/E to hit the streets and then it'll be a whole new ballgame.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: The Two Roads to Ajax Posted: Aug 23, 2006 1:22 PM
Reply to this message Reply
I think the argument is more black and white put than need be.

The real difference between using eg Dojo directly and a server side framework like Wicket (which btw may use Dojo just as well) is that in the first case you insert your Ajax code manually, while in the second case you have a framework that takes care of that. Letting a server side framework do the inserting for you does not have any inherent disadvantages other than possibly the framework's inflexibility - which of course largely depend on that specific framework. A good server side framework can help you organize your code better, and hide nasty details for you if that would be a concern, and typically it comes out of the box with a client-server communication mechanism. Imo usually a good idea. Though if you know what you're doing working with e.g. Dojo directly is really fine.

I'd like to summarize that imho there are no two roads, but rather a gradient in how much you want to make use of any framework - whether such a framework has more focus on the client or on the server.

nes

Posts: 137
Nickname: nn
Registered: Jul, 2004

Re: The Two Roads to Ajax Posted: Aug 23, 2006 3:47 PM
Reply to this message Reply
> http://www.javascriptlint.com/

Thanks looks promising. Should have really searched it before asking (first google link for javascript lint).

Johannes Link

Posts: 3
Nickname: jlink
Registered: Sep, 2004

Re: The Two Roads to Ajax Posted: Aug 24, 2006 10:34 AM
Reply to this message Reply
One more hint on the issue of an inbetween approach: The Model-View-Presenter idea seems very well suited for (some kind of) Ajax applications. See http://jlink.blogger.de/20060324/ for more details on that topic.

Jules Jacobs

Posts: 119
Nickname: jules2
Registered: Mar, 2006

Re: The Two Roads to Ajax Posted: Aug 25, 2006 7:19 PM
Reply to this message Reply
> But it's not the same.

No, but still *very* simililar if you compare Java and Javascript+Actionscript.

> Yeah, and your point is?

Is Java getting real closures? Probably, but why only examples of things that could have been done with anonymous classes?

> It doesn't have to be limited to anything. It's
> primarily used in the browser.

Then we completely agree! (recall: "the problem is that Javascript is for all intents and purposes, limited to the browser").

> I don't think anybody is "afraid" of Javascript. More
> likely is that people don't like switching languages, and
> to give developers a toolkit that feels like traditional
> thick clients.

> Haskell has a lot of scary features for someone that
> hasn't used them.

Yes, and that's why most programmers don't (want to) use it, just like Javascript.

> I wouldn't put either in my list of favorites.

I wouldn't either, but Javascript does give me a positive feeling, rather than a negative one.

> Great, but doesn't really have anything to do with my
> point - which was that if the flash 9 VM has the chops to
> handle a subset of Java, then that would only expand
> developer interest in the platform.

Not everything I say has something to do with your point.

> We'll wait for WPF/E to hit the streets and then it'll be
> a whole new ballgame.

OK.

Sorry, it's late here.

Manish Jethani

Posts: 53
Nickname: jethani
Registered: Aug, 2005

Re: The Two Roads to Ajax Posted: Sep 1, 2006 4:31 AM
Reply to this message Reply
>I'm going to make a prediction. Adobe or someone else will write a Java compiler that targets Flash 9 or above.

Not Java, but we've got an ECMAScript 4 implementation called ActionScript 3.0. It's got the OO features, it's got strong typing, native regex, E4X, the works...

http://labs.adobe.com/wiki/index.php/ActionScript_3

Flat View: This topic has 26 replies on 2 pages [ « | 1  2 ]
Topic: The Two Roads to Ajax Previous Topic   Next Topic Topic: Getting Serious about Preserving Behavior


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us