Google Web Toolkit

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

jman19

Lifer
Nov 3, 2000
11,225
664
126
Originally posted by: brikis98
Originally posted by: Martin
Originally posted by: jman19
Originally posted by: kamper
Originally posted by: brikis98
* Your can write clean, OO Java instead of incomprehensible JavaScript.
That's not an advantage, javascript is a very nice language!

Yeah, these days, JS is quite nice :thumbsup:

I was just about to say that - JS is probably the most misunderstood and unappreciated language out there. I've been doing more and more of it lately and I find that the more I use it, the more I love it, to the point where going back to things like PHP and (god forbid) Java makes me want to start crying

While the language itself is fantastic, it certainly could use better tools and libraries. Thankfully with things Firebug, ExtJS 2.0, Prototype 1.6, and AIR its increasingly feasible to write the bulk of your apps in JS.

I have been coding for a long time and in all honesty, i'm shocked that anyone can prefer coding in JavaScript over Java... I mean, obviously they are vastly different languages for different purposes, but if all else was equal and you could pick Java or JavaScript, I'd wager 99% of experienced software engineers would pick Java. that's not to say that Java is the best language out there, but compared to JS, it's not even a contest.

one of the reasons we have all these frameworks - ExtJS, ProtoType, and of course, GWT - is because JS is such a PIA to work with. lack of proper scope, proper typing, proper debugging tools, proper class/interface definitions, strange syntax, weak unit testing frameworks, etc etc make it a nightmare to deal with. to compound the situation, different browsers handle JS differently, making you have to deal with tons of stupid browser quirks all day long.

to each their own of course, but honestly, i'm curious what on earth makes you prefer JS over Java?

What I meant about JS being quite nice is that I like it more than Java as a language. Java is more bloated than Fat Bastard and is a PITA to code in. Dev tools aside, JS is better. Java of course has more going for it in terms of building systems.
 

singh

Golden Member
Jul 5, 2001
1,449
0
0
Originally posted by: brikis98
out of curiosity, Singh and Martin - do you use Javascript in a company/team setting? that is, in one where many people are working on the same code?

while the links you posted show interesting features of JavaScript - really, just standard functional programming features - the language is generally hard to use in a development environment. JS has very little in the way of compile time errors, it can be a nightmare to debug (IE loves to tell you the error is ALWAYS on line 1, char 1), there are few good unit testing frameworks, it has problems with proper scoping/variable declaration/etc, and any functional programming language - where you can wrap an absurd amount of functionality into one line - is naturally very tough to read and maintain. there is a reason most modern languages are object oriented and similar to Java and that's because in a production environment, developing, maintaining and debugging JS is very very hard.

now don't misunderstand me. functional programming is very powerful and has it's place, but IMO, coding for UI and applications is NOT it. and yes, obviously large, effective applications have been built with JS, but not without a lot of blood and sweat. google, of all companies, is a master of JS (gmail, gcal, gdocs, etc etc), and they are using this framework themselves. that should probably tell you something...

i also agree that, in general, for simple things, JS has less overhead than Java. but if we were doing something simple, we wouldn't be looking for a JS framework to begin with. as soon as the complexity of the code increases, Java - in part because of all the "legal contracts", as you put it - is far more effective.


I work for a small company, so it's typically only 1-2 developers. I understand that in larger environments, straight JS may not be the best option. However, even my JS code is very well modularized and spread over 15 different source files, and not a single monolithic program. Using Firefox + Firebug makes it really easy to debug JS code. Forget about IE for development. I usually don't test on it till whatever changes I'm making are completed and tested in FF. Of course, sometimes one does run into issues with JS code on a specific browser, but it happens less and less.
 

txlonghorn

Senior member
Jul 26, 2004
380
0
76
Coding with JavaScript is like playing with a loaded gun. In the hands of a sharp-shooter, he can shoot the wings off a fly. In the hands of a novice, he can shoot off his own foot.

I cut my teeth on Smalltalk, which IMO, is the most elegant and the purest OO language. James Gosling claims that he took the best of Smalltalk and C++ when he invented Java. I contend that to took the worst of both instead. Anyway, I agree with a lot of the not-so-positive comments about Java. I use it everyday to make a living but many times, I cuss at Sun for butchering its implementation. Any way, as poorly implemented as Java is, it is still a lot easier to train a novice to code Java than JavaScript. The "legal contract" forces disciplines, where as the "conversation" does not. I remember many painful lessons I learned about JavaScript under the scrutiny of paying clients. Those lessons made me a better JS developer, but they were painful to learn under the circumstances.

On the other hand..... I am now using a commercial JS package which renders amazing 2-D graphics, something I can never imagine myself do with JS. That gave me a healthy respect for what you can do with JS in the hands of experienced developers. Hence my opening remark.
 

Martin

Lifer
Jan 15, 2000
29,178
1
81
Originally posted by: brikis98
out of curiosity, Singh and Martin - do you use Javascript in a company/team setting? that is, in one where many people are working on the same code?

while the links you posted show interesting features of JavaScript - really, just standard functional programming features - the language is generally hard to use in a development environment. JS has very little in the way of compile time errors, it can be a nightmare to debug (IE loves to tell you the error is ALWAYS on line 1, char 1), there are few good unit testing frameworks, it has problems with proper scoping/variable declaration/etc, and any functional programming language - where you can wrap an absurd amount of functionality into one line - is naturally very tough to read and maintain. there is a reason most modern languages are object oriented and similar to Java and that's because in a production environment, developing, maintaining and debugging JS is very very hard.

now don't misunderstand me. functional programming is very powerful and has it's place, but IMO, coding for UI and applications is NOT it. and yes, obviously large, effective applications have been built with JS, but not without a lot of blood and sweat. google, of all companies, is a master of JS (gmail, gcal, gdocs, etc etc), and they are using this framework themselves. that should probably tell you something...

i also agree that, in general, for simple things, JS has less overhead than Java. but if we were doing something simple, we wouldn't be looking for a JS framework to begin with. as soon as the complexity of the code increases, Java - in part because of all the "legal contracts", as you put it - is far more effective.

Well, in my previous job, where I really got into JS and web dev, I was on a team of 4 doing internal software and dynamic languages (JS in PHP in this case) were not only not a problem, but allowed us to get a lot of stuff done. And even though internal software has some stigma to it, the stuff was by no means a toy - the crown jewel being a change management system that more than held its own against commercial apps costing into the hundreds of thousands and RIM (blackberry maker) is not some small irrelevant company either

I also worked for a while with 2 other people on our own little project that was very heavily JS - a web-based IDE where everything except file access was JS based - UI, syntax highlighting, searching, etc.

Anyway, I haven't been programming too long, but I suspect a lot of the need for java's verbosity isn't needed and we'll see more and more of a move towards ECMAScript. For example, if you're developing with Adobe AIR you get stuff like SQL libraries, file access, socket communications etc all used with ECMAScript. And adobe itself is said to be moving to these types of applications, albeit slowly (see Photoshop Express).


To be sure, JS in the browser does have a quite a few drawbacks, but for me at least, the benefits outweigh the negatives right now.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I agree with you, but in general, I leave the "contract" part for the server while having some fun on the client/browser side. This provides a lot of flexibility and modularization.

Absolutely true. But that's a pretty specific context, i.e. client-server applications built on HTTP/HTML/XML and hosted in a browser. Despite the fact that we've all been focused on web apps for ten years now, they are not the most challenging, and certainly not the most mission-critical, software applications. I'm knees-deep in one legacy retail system at the moment that has several hundred klocs of C/C++ and was written by 300 consultants over 35 years. I think there are more than 50 engineers working on it right now.

So when I think about the advantages and disadvantages of interpreted, dynamically typed languages it's across all these contexts. If the discussion is really about web apps then the debate is moot. In the broad world of software development, web apps are sandboxes where we get to play with toys .
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: PhatoseAlpha
Hmm. Interesting. Are there any Java dev environments as usable as VB/VS? Particularly ones with something as useful as vb's intellisense and particularly some way of turning off case sensitivity?
I used VS for a couple of months in 2006. I think it was 2k3, maybe 2k5 (which came out with .net 2.0?). I used eclipse heavily for several years before that. Eclipse blew the socks off of VS in terms of code intelligence.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: brikis98
JS is such a PIA to work with. lack of proper scope,
Considering how little syntactic effort is devoted to it (no namespace mechanisms, classes a bit weird) javascript has amazingly good scoping capabilities. You do have to be careful with the global scope of course.

proper typing,
For some definition of 'proper'

proper debugging tools,
Firebug is pretty sweet, although slowish. I haven't done java/.net development in a while but when I did, even the biggest IDEs didn't come with profilers built in. Debugging on other browsers is, of course, painful but as someone else said, that can mostly be pushed to small tweaks after you've got the bulk of the code working.

proper class/interface definitions,
I'm still trying to get used to prototype inheritance and ultimately I don't think I'll like it as well as classical, but again, it's pretty impressive how much mileage javascript gets out of the simple syntax. And again, 'proper' doesn't have to mean whatever you were brought up with

strange syntax,
Examples?

different browsers handle JS differently, making you have to deal with tons of stupid browser quirks all day long.
As someone else also pointed out, the quirks are mostly in the api and you learn those fairly fast. Javascript 1.5 support is pretty good across the board although I'd really like to start using some of the 1.6-1.8 features with some assurance that non-firefox people can still run it. Not likely to happen
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
Originally posted by: kamper
Originally posted by: PhatoseAlpha
Hmm. Interesting. Are there any Java dev environments as usable as VB/VS? Particularly ones with something as useful as vb's intellisense and particularly some way of turning off case sensitivity?
I used VS for a couple of months in 2006. I think it was 2k3, maybe 2k5 (which came out with .net 2.0?). I used eclipse heavily for several years before that. Eclipse blew the socks off of VS in terms of code intelligence.

C# or VB.net? Last I checked, VS was nowhere near as helpful in C# as it is in VB.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: Martin
I was just about to say that - JS is probably the most misunderstood and unappreciated language out there. I've been doing more and more of it lately and I find that the more I use it, the more I love it, to the point where going back to things like PHP and (god forbid) Java makes me want to start crying
Oddly enough, it's been python programming that is making me cringe when I mix it with javascript. The scoping is lacking (mostly, I think, because the lack of a 'var' keyword) and using whitespace for formatting really stops you from abusing the syntax to compress things

Java wouldn't worry me too much. It's such a shift that I'd just forget about all the functional things I like to do in javascript and get back into verbose, java-style-OO mode.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: PhatoseAlpha
Originally posted by: kamper
Originally posted by: PhatoseAlpha
Hmm. Interesting. Are there any Java dev environments as usable as VB/VS? Particularly ones with something as useful as vb's intellisense and particularly some way of turning off case sensitivity?
I used VS for a couple of months in 2006. I think it was 2k3, maybe 2k5 (which came out with .net 2.0?). I used eclipse heavily for several years before that. Eclipse blew the socks off of VS in terms of code intelligence.

C# or VB.net? Last I checked, VS was nowhere near as helpful in C# as it is in VB.
Oh, interesting. It was c#. That's odd, I got the sense that c# was really the primary .net language so I assumed it would be at least as good as vb.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
It's a strange affair, really. The microsoft guys push C#, C# has some features here and there that VB doesn't - unmanaged code and pointers jump to mind - but VS really plays a "I'm gonna get out of the way" when coding in c#. VB is pushed as a RAD and novice developer tool, so the UI is about 10 time more helpful. C#......No list of form events, far less helpful intellisense.......C# and VB are clearly two aspects of the exact same thing, aimed at two widely different audiences. Who incidentally hate each other.

Honestly, I wish they would just ditch both, make one .net language with a couple of toggleable syntax and environment settings in VS to make it mimic on language or the other, and give everybody the power of C# with the usability of VB.net. The bifurcation they have now is clearly a historical relic, and it hurts everybody in the long run.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: kamper
Originally posted by: PhatoseAlpha
Hmm. Interesting. Are there any Java dev environments as usable as VB/VS? Particularly ones with something as useful as vb's intellisense and particularly some way of turning off case sensitivity?
I used VS for a couple of months in 2006. I think it was 2k3, maybe 2k5 (which came out with .net 2.0?). I used eclipse heavily for several years before that. Eclipse blew the socks off of VS in terms of code intelligence.

eclipse is by far the best IDE i've ever used. i've used several versions of VS (from 6.0 up to some .net flavor), netbeans and several others, and it's honestly a no-contest. once you know how to properly use eclipse - including a few essential short cuts (alt + space, ctrl + shift + r) - it's incredible how much time it saves you.

the fact that it's open source and extensible means a MASSIVE plugin community, including integration with every kind of source control (CVS, subversion, etc), bug tracking (mylyn, bugzilla, etc), tons of debugging & performance tools, decent UI tools and even support for MANY languages beyond Java (C, C++, HTML, CSS, XML, and so on and so forth). the platform is so extensible and flexible, you can do almost any kind of development in it and it really blows away the competition.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: PhatoseAlpha
Honestly, I wish they would just ditch both, make one .net language with a couple of toggleable syntax and environment settings in VS to make it mimic on language or the other, and give everybody the power of C# with the usability of VB.net. The bifurcation they have now is clearly a historical relic, and it hurts everybody in the long run.

Nah, you're just getting the abstraction wrong, honestly. CIL is the single .Net language. C# and VB are "toggleable syntax" sets, if you will. IDE support isn't seamlessly consistent across all the languages for many different reasons, although under the hood you can almost always do the same things.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
Ah, so it's one of those open source projects that kind of sucks out of the box, but if you're willing to put in the considerable time and effort to get it the way you want it, it saves you time in the end?




Edit: Yes, it all becomes CIL in the end. Perhaps I'm looking for a much finer grain of toggleability on the syntax and environment. I'm just thinking it should probably be a thing where I can use static or shared, set whether or not I want to use curly braces or End If or whatever, have semicolons but case insensitive, Unsafe code blocks but the useful event pull downs on forms.

 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: PhatoseAlpha
Ah, so it's one of those open source projects that kind of sucks out of the box, but if you're willing to put in the considerable time and effort to get it the way you want it, it saves you time in the end?
Not really, I never tweaked eclipse and it was still featury (to the point of bloat). I hear it's gotten a lot better in recent years as well with things like xml support and app server integration.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
Ah. Well, maybe I'll give it a long look over some time when I've got a free afternoon and enough patience to consider a new dev environment.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Edit: Yes, it all becomes CIL in the end. Perhaps I'm looking for a much finer grain of toggleability on the syntax and environment. I'm just thinking it should probably be a thing where I can use static or shared, set whether or not I want to use curly braces or End If or whatever, have semicolons but case insensitive, Unsafe code blocks but the useful event pull downs on forms.

Syntax and grammar are our friends . What you propose sounds fun for fooling around, and there are parser toolkits out there that will damn near let you build whatever language you want. But we need programs to be consistently interpretable across time and space, and a proliferation of configuration options wouldn't make managing the development process any easier.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: kamper
Considering how little syntactic effort is devoted to it (no namespace mechanisms, classes a bit weird) javascript has amazingly good scoping capabilities. You do have to be careful with the global scope of course.

again, you need to listen to what I'm saying: JS is problematic in a (larger) team setting. these "weird" classes, lack of namespace and global scope issues are exactly what cause issues on a large team. just as importantly, such code is EXTREMELY tough to maintain. Wth the severe lack of effective coding, debugging and unit testing tools for JS, it is very difficult to anticipate, for example, what a minor code change affects.

so far, all the ppl replying have been on teams of just a few people, which is quite insignificant compared to the corporate setting I'm speaking of. i doubt they have felt the pain of digging through thousands of lines of JS code developed by dozens of other developers and trying to make sense of it. it's a nightmare. however, on a daily basis, I easily find my way through massive Java code bases (typically of open source projects, including GWT) without breaking a sweat.

Originally posted by: kamper
For some definition of 'proper'

how about any typing (during compile time) whatsoever? i HATE not knowing if the var I'm using contains a string or a number. The + is overloaded, so it might be concatenation or it might be addition. I have to use stupid tricks (such as multiplying each var by 1 or adding a "") to make sure. what a stupid waste.

again, if it's your own code you're editing, you probably know what's going on and it's not an issue. but try to maintain a large code base that others have written, and you run into difficulties really really quickly.

Originally posted by: kamper
Firebug is pretty sweet, although slowish. I haven't done java/.net development in a while but when I did, even the biggest IDEs didn't come with profilers built in. Debugging on other browsers is, of course, painful but as someone else said, that can mostly be pushed to small tweaks after you've got the bulk of the code working.

firebug is an awesome plugin. I honestly can't remember how I lived without it. it's a fantastic tool and i desperately want an equivalent for IE.

having said that, firebug absolutely pales next to the profiling and debugging tools in eclipse (and similar IDE's). integrated JUnit testing, JTest, Findbug, the debugger itself, the entire Test & Performance Tools Platform (TPTP) - not to mention the thousands of compile time checks - blow firebug and most other JS tools I've seen out of the water.

and honestly, you're being a bit too optimistic here. a great deal of a web dev's time is spent fighting with browser quirks. if you're a web dev, you know full well that just because it works in FF means NOTHING about other browsers, especially the #1 browser in the market, IE. and even if you get that sorted out, you still need to deal with all the different versions of FF and IE, Safari, Opera and so on.

Originally posted by: kamper
I'm still trying to get used to prototype inheritance and ultimately I don't think I'll like it as well as classical, but again, it's pretty impressive how much mileage javascript gets out of the simple syntax. And again, 'proper' doesn't have to mean whatever you were brought up with

i've used plenty of JS, various functional programming languages (SML), pascal, VB, Java, C++, C#, PHP, PERL and a bunch of others. i wasn't "brought up" liking one or the other, but after years of experience in working at large companies, my personal preference would be to NOT use JS for anything large scale. Again, Java is far from perfect, but it's honestly a no brainer when stacked up against JS.

Originally posted by: kamper
Examples?

obviously, syntax preference is very subjective, but i find JS much more painful to read than Java. the way objects are defined and the whole prototype structure is especially painful.

java, in part due to the fact that it is built like a legal document, is very easy to read and follow. in the hands of an even mildly competent developer, it is often fairly self documenting. i cannot say the same for JS, even with the best of developers.

and as i've been saying all along, Java also has nice IDE's that let you follow the entire path of a piece of code - with one click, see all references to the code, the type hiearchy, all implementations of an interface, and much more.

Originally posted by: kamper
As someone else also pointed out, the quirks are mostly in the api and you learn those fairly fast. Javascript 1.5 support is pretty good across the board although I'd really like to start using some of the 1.6-1.8 features with some assurance that non-firefox people can still run it. Not likely to happen

well, javascript is not nearly as bad as css. however, the JS link only shows event compatibility. the way you access page elements, do AJAX, find mouse position, scrollbar position and much more varies quite a bit from browser to browser.

i don't know what world you live in - maybe you only need to support 1 browser - but cross browser compatibility is a major thorn in most web developers' sides. i agree that the frameworks available for JS (protoype, moo tools, etc) have made this significantly easier, but that just shows that by itself, JS is a massive PITA to work with.

now again, i need to reiterate that (obviously) it's not impossible to be successful with JS. there have been many successful apps built with it and as AJAX becomes more popular, JS will only grow in popularity and usage. i'm sure the language in future versions will also significantly improve - as will, hopefully, browser support - to the point where it's tolerable. but in it's current form, all else being equal, i'd pick java.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |