Slashdot Mirror


GWT in Action

Michael J. Ross writes "Server-side computer languages, such as Java, possess numerous advantages over their client-side counterparts — including more robust integrated development environments (IDEs). In contrast, Web-focused languages, such as JavaScript, benefit from the global accessibility of the Internet. Bridging this gap, and leveraging the strengths of both sides, has long been an objective of the software development community — though not all attempts have been successful, e.g., Java applets. The Google Web Toolkit (GWT) is the latest attempt, and shows considerable promise, as illustrated in a new book intended to help programmers learn this new technology: GWT in Action." Read on for the rest of Michael's review GWT in Action author Robert Hanson and Adam Tacy pages 600 publisher Manning Publications rating 6 reviewer Michael J. Ross ISBN 1933988231 summary A practical introduction to programming with the Google Web Toolkit (GWT). Written by Robert Hanson and Adam Tacy, this book was published by Manning Publications on 5 June 2007, under the ISBNs 1933988231 and 978-1933988238. For any prospective reader who would like to learn more about the book, they can first try the book's Web page, where they will find online versions of the "about this book" section, table of contents, preface, and index. The publisher offers two freely downloadable chapters, "Creating the Default Application" and "Communicating with GWT-RPC," in PDF format. In addition, there is a link to purchase the book's electronic version, and a link to the author's forum, where readers can post questions about the book or GWT, and likely receive a response — perhaps even by one of the authors.

The book's 17 chapters are organized into four parts, and cover a generous number of topics: introduction to GWT; creating the default GWT application; building your own application based upon the default one; creating widgets and panels, including composite panels; processing user events; creating JSNI components; modularizing your code; communicating using GWT-RPC; client-side RPC; classic Ajax and HTML forms; using JSON for interoperability; automatically generating code; GWT's native properties; testing and deploying GWT applications; more on the inner workings of GWT itself. The book has no appendices, but a substantial index, which is essential for such a technically detailed subject area.

GWT in Action is clearly intended to be a practical and fairly comprehensive coverage of Google's new toolkit. Almost all of the GWT concepts are explained within the context of developing a substantial sample application, the Dashboard, created by the authors. The reader is encouraged to follow along as the authors build the application, thereby learning from doing — almost always an effective approach. At 600 pages, with almost none of the formatting padding found in far too many technical books nowadays, the authors have not skimped on providing the reader with a lot of information. Furthermore, their treatment of application deployment is far better than any other I have encountered.

Unfortunately, the book has many weaknesses. On an overall basis, the order of presentation is at times disjointed — seemingly dictated more by the Dashboard and less by the most logical order for someone new to GWT. Compounding the problem, the authors frequently refer to advanced topics, covered in greater detail later, and also repeat earlier information, occasionally several times. Despite promises to provide a gentle exposition, it can be difficult at times for the reader to determine if any critical steps were skipped, as a consequence of key instructions for building the sample application being spread out, and interspersed with too many references to general comments covered earlier. In turn, readers will likely find it frustrating to try to get the sample application working at each step of the development process — and not just at the end, with the complete code.

One source of these difficulties, is that in the first few chapters, the authors try to introduce too many topics all at once, and as a result do not thoroughly discuss each one in its own section. Instead, they break up the information over multiple sections, scattered throughout the book. An example of this is internationalization. Section 2.2.4 is titled "Implementing Internationalization," and yet provides almost no details, and is essentially unusable by itself. At the very least, it should mention that later sections 3.2.1 and 15.3 provide a lot more information. Furthermore, internationalization was introduced far too early in the book, and greatly complicates the process. Instead, the authors should have created a simple application using only English for the user interface, and introduce internationalization later, after fully explaining the basics of turning Java code into JavaScript functionality.

Part I of the book is the weakest of all of them, which may, sadly, turn off readers who would otherwise get to the better material later. The authors are clearly enthusiastic about the topics at hand, and the number of moving parts associated with Java/JavaScript/GWT development is certainly not trivial. Nonetheless, those initial chapters would greatly benefit from a rewrite; this would make the material more comprehensible and easier to follow, step-by-step.

We can mention some specific flaws: A book like this that is introducing a new technology, must take care to not leave the unwarned reader wondering if they have been left behind in the steps. People reading some of the earlier material may conclude that those steps have already been assumed by the authors, and will not be covered. The authors do not mention how to obtain and install GWT until page 30; that should be right up front. The authors do not appear to mention which version of GWT they used for the book. (I chose 1.3, not 1.4RC, available as of this writing). Any reader trying to follow along and implement their example application (the Dashboard) will probably find several hurdles. First of all, make sure that you have version 1.4 of GWT installed, and not 1.3.3, which does not include some of the panels and widgets used in their sample code.

In Chapter 1, they modify a "Hello world" application to create another application that shows a tic-tac-toe board that has clickable squares, but does not play the game. Chapter 2 describes this as "a fully functioning Tic-Tac-Toe application," which is like claiming a program works because it compiles. Also in Chapter 2, their discussion of development alternatives is slowed down by repetition of the same information. The sample code in the book has minor inconsistencies. For example, naming a password String "oldPass" in one method, then "old" in another, related method. There are other instances, but these give one an idea of some of the inconsistencies.

The coverage of topics is generally quite thorough, though at times verbose and redundant — particularly in Chapter 2, though it is certainly not limited to that chapter. The second and third paragraphs in Chapter 3, for instance, continue the repetitious style which is found in many places throughout the book, and likely has made it longer than necessary. In Chapter 4, the first two pages explain what widgets are, several times, and conclude with a picture of a button — as if any reader who has made it that far into the book doesn't know what a button is. The book could certainly use some trimming.

The downloadable source code is not complete. For starters, it is missing the code from Chapters 1 and 2, though admittedly none of that is too long. The code provided for Chapter 4 is just a portion of what is displayed in the book. Moreover, the directory paths in the sample code archive files, are not consistently named, and some may even be incorrect. For example, the code for Chapter 5 has a folder named "Dashboard — Chapter 4." That sort of thing does not instill confidence in the typical reader. The authors should revisit the sample code — making it complete and consistently named.

The publisher's page for the book does not appear to have a link for errata; perhaps none have been reported yet. Here are some: On page 75, in Table 3.1, in the left-hand column, "gwt-onLoadErrorFn" should instead read ""gwt:onLoadErrorFn." On page 77, in the second paragraph, the file name extension should be all lowercase, not all uppercase. On page 78, in Listing 3.6, the String parameter in the first label.setText() call should be delimited with straight quotes, not curly quotes. (Microsoft Word strikes again?!) On page 81, in the third paragraph, "comply to" should read "comply with." On pages 87 and 88, the -whitelist and -blacklist option values each contain an extraneous space before the "^." There are undoubtedly more such errata throughout the book, and can be corrected in the next edition; but these are enough to at least get an errata file started. Fortunately, none of them would lead an alert reader astray.

Even though the book could use significant reorganization and streamlining in the next edition, GWT in Action is packed with practical information on a wide range of GWT topics.

Michael J. Ross is a Web developer, freelance writer, and the editor of PristinePlanet.com's free newsletter.

You can purchase GWT in Action from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

216 comments

  1. Wow by thatskinnyguy · · Score: 1, Insightful

    That's a lot of reading. Can someone sum it up in 5 words or less for us lazy people? Thanks in advance.

    --
    The game.
    1. Re:Wow by Drew+McKinney · · Score: 5, Funny

      That's a lot of reading. Can someone sum it up in 5 words or less for us lazy people? Thanks in advance. Comprehensive. Disjointed. Overwhelming. Broken code.
    2. Re:Wow by cromar · · Score: 3, Interesting

      He seems to be saying that overall it's a good book :D

      Is it just me or is anyone else glad to see a review on Slashdot without a chapter by chapter summary? One of the most pointless, pedantic mistakes in book reviews is to summarize each chapter. Hoozah for the writer!

    3. Re:Wow by hansamurai · · Score: 3, Funny

      From actually having tried out GWT, here's my five (and a half) words of advice:

      Don't Use Google Web Toolkit.

    4. Re:Wow by trondotcom · · Score: 1

      Screenshots would be helpful as well :-)

    5. Re:Wow by Anonymous Coward · · Score: 0

      Can someone sum it up in 5 words or less for us lazy people?

      Don't buy this book, sir.

    6. Re:Wow by doofusclam · · Score: 3, Informative

      Well, i've avoided writing web stuff for my whole career but when I got lumbered with a project at work I used GWT.

      Firstly, I had loads of problems. However they were mainly down to broken stuff in the RC builds (all fixed now that it's out of beta) and the fact that I was learning Java as I went along. Nothing that was a major problem was down to the architecture of GWT.

      If i'd have written pure javascript instead then doubtless it'd have taken far longer and worked less well.

      GWT rocks for anything where you need to write anything with a rich web gui and a large amount of interaction between this and a backend. I can use Eclipse to single step through my Java code, with breakpoints and all that stuff. GWT also takes all the browser specific hassles away, for example with the differing rich text area implementations used by all the browsers. Without these niceties i'd have given up on web development before i'd even started.

      Oh and the google group for GWT is great - i've had problems answered within ten minutes. The Google team are very visible and are obviously proud of their product. Rightly so, too.

    7. Re:Wow by matto11 · · Score: 1

      if you can't see the benefit of using GWT for certain applications then you don't know what you are doing. why spend valuable time debugging javascript to work across all browsers when you can use GWT and spend that time building more features. use the right tool for the right job.

    8. Re:Wow by Angostura · · Score: 2, Interesting
      Here's what happens when I take the review and run it through Microsoft Word's 'Autosummarize' Tool, set to the most violent setting: "100 words or less":

      The publisher offers two freely downloadable chapters, "Creating the Default Application" and "Communicating with GWT-RPC," in PDF format. Unfortunately, the book has many weaknesses. The authors do not appear to mention which version of GWT they used for the book. The sample code in the book has minor inconsistencies. For example, the code for Chapter 5 has a folder named "Dashboard -- Chapter 4."
      ... yup, that seems to cover most of it.
    9. Re:Wow by thatskinnyguy · · Score: 1

      I was unaware of such a tool. o_O I'll have to use that in the future.

      --
      The game.
    10. Re:Wow by PoliTech · · Score: 1
      At first I thought this was going to be an article about the Global War on Terror.

      Google Web Toolkit

      Who'd a thunk?

    11. Re:Wow by fimbulvetr · · Score: 0, Troll

      "Java" would have sufficed.

    12. Re:Wow by johnharrisyankee · · Score: 1

      i second that vote mate!

    13. Re:Wow by crush · · Score: 1

      Agreed. That was an excellent review which certainly gave me a feeling for the book's content, approach and failures. Even though it was slightly critical I'll be giving the book a shot, mainly because it sounds like although it could have done with restructuring it's nevertheless comprehensive.

      One of the best Slashdot reviews in a while.

    14. Re:Wow by jgertzen · · Score: 1

      Agreed... shameless plug here... but you might give ThinWire a try instead.

  2. The more I learn about JavaScript... by SanityInAnarchy · · Score: 4, Insightful

    The more I learn about JavaScript, the more I like it as a language.

    I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point. I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.

    Well, almost. The problem with JavaScript is that it's horribly slow to execute. But then, you still have that problem, even if it's JavaScript generated from Java code.

    --
    Don't thank God, thank a doctor!
    1. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      They did it was called Netscape Enterprise Server. SSJS died a horrible death a long time ago thank god!

    2. Re:The more I learn about JavaScript... by Octopus · · Score: 1

      JavaScript generated from Java code EW. LIKE RECONSTITUTED BOOGERS.
    3. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0
      I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.

      Someone did build a webserver platform around JavaScript.
      It was a product from Borland called Intrabuilder.

      Circa 1997:

      Borland, with IntraBuilder, is one of the first vendors to release a complete client/server application development environment for intranets. The product is full-featured, including a wizard-filled IDE that supports the JavaScript language for both server- and client-side scripting. A JavaScript server engine for run-time application support (IntraServer) uses the Borland Database Engine for database connectivity during both design and run time.
    4. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Care to elaborate on what sucked about it?

      I know, for one thing, that JavaScript started out as a horrible little language, and within a year or so, it became a beautiful little language. I imagine that we could do better, were the same thing attempted today.

      --
      Don't thank God, thank a doctor!
    5. Re:The more I learn about JavaScript... by jmyers · · Score: 2, Funny

      "I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter."

      duh... IIS and asp
      @ Language=JavaScript

    6. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 2, Interesting

      The problem with JavaScript is that it's horribly slow to execute.

      Depends on your engine. I've put some thought into the same sort of server-side Javascript engine as you have. Someone else mentioned the Netscape Enterprise Server. That was... not so great. I was thinking more along the lines of building on top of a Java Servlet Engine. The Mozilla Rhino Javascript Engine actually compiles the JS down to Java byte code. That wouldn't be all that special, except that the JVM then JITs that to native code. Which means that Javascript doesn't have to be slow. ;)

      I figure you could create a JSHttpServlet object and map a file of your own extension (it can be *.js if you want it to be) to that servlet. The servlet then creates a JS environment that maps HttpRequest and HttpResponse as global variables. You can even map HttpSession and a PrintWriter output stream if you want. (That gets pretty close to JSP territory. ;-)) Load the script at init() time, and execute it when called.
    7. Re:The more I learn about JavaScript... by RManning · · Score: 1

      I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.

      Not to date myself, but I remember using Netscape LiveWire. It sucked. I was so glad to move to Perl/CGI and then even happier when we moved to J2EE.

      Anyway, there's been a number of server side JavaScript implementations.

    8. Re:The more I learn about JavaScript... by fireboy1919 · · Score: 2, Interesting

      But then, you still have that problem, even if it's JavaScript generated from Java code. That's not really what's going on.

      GUI stuff happens in Javascript. Anything really complicated gets sent over to Java. That's why it's called an AJAX framework, not a Javascript framework.

      I like Javascript, but it has the same problem as PHP: no namespaces. Using it as a real language would causes the same problems you see there: security issues, hard-to-read code, difficulty refactoring, interoperability problems, etc. You can actually see those problems and the various mechanisms to overcome them in a lot of the modern pure-javascript libraries (prototype especially is known for breaking existing javascript libraries, for example).
      --
      Mod me down and I will become more powerful than you can possibly imagine!
    9. Re:The more I learn about JavaScript... by majorbugger · · Score: 1

      First, Javascript is a horrendous language. It is full of unexpected quirks, and compared to other dynamic languages such as Python or Ruby it is hell to work with. That's why frameworks like Prototype or jQuery emerged. The power of GWT and similar frameworks is that they provide ready to use components which render similarly across all browsers, making it feasible to prepare a fully functional and nicely lookung web UI in a matter of minutes.

    10. Re:The more I learn about JavaScript... by ZeroConcept · · Score: 1

      - In JavaScript you find all errors at runtime, in Java you can catch many at compile time.
      - Differences in browsers object models makes it counter-intuitive to write cross-browser JavaScript code, GWT can take care of these differences for you.

    11. Re:The more I learn about JavaScript... by multipartmixed · · Score: 1

      > I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.

      Netscape did that, back in the "four days", google up "server-side javascript".

      > Well, almost. The problem with JavaScript is that it's horribly slow to execute.

      Bullshit. The types of JOBS people usually try to do with JavaScript may be slow, however. Or the native methods that the javascript programs are using might be... But that's a far cry from making it a slow language. It's not substancially slower or faster than any similar functional or imperitave language I can think of (Pascal, Object-Oriented Turing, Miranda, LISP) for comparable jobs. Although LISP probably kicks its ass if your job is heavily recursive.

      > But then, you still have that problem, even if it's JavaScript generated from Java code.

      I don't know what you're talking about here. JavaScript is completely unreladed to Java.

      That said, there is a JavaScript interpreter written in Java called Rhino. But if you were looking for speed, I would certainly look at a C implementation (like spidermonkey or NJS) first.

      --

      Do daemons dream of electric sleep()?
    12. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      > But then, you still have that problem, even if it's JavaScript generated from Java code.

      I don't know what you're talking about here. JavaScript is completely unreladed to Java.

      Do you even know what this article is about? Google Web Toolkit works by compiling Java code into Javascript and HTML.

      http://code.google.com/webtoolkit/overview.html:

      What is Google Web Toolkit? ...

      Here's the GWT development cycle:

                    1. Use your favorite Java IDE to write and debug an application in the Java language, using as many (or as few) GWT libraries as you find useful.
                    2. Use GWT's Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server.
                    3. Confirm that your application works in each browser that you want to support, which usually takes no additional work.
    13. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 1

      That said, there is a JavaScript interpreter written in Java called Rhino. But if you were looking for speed, I would certainly look at a C implementation (like spidermonkey or NJS) first.

      That's just goofy. Spidermonkey is quite a bit slower than Rhino. They both contain runtime compilers, but Spidermonkey has its own interpreter. Rhino compiles down to Java bytecode which is then JITed by the JVM. If you want performance, use Rhino!
    14. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 1

      Sorry, that should read "Spidermonkey has its bytecode own interpreter." Which is slow. Very slow.

    15. Re:The more I learn about JavaScript... by Bluesman · · Score: 1

      A couple of days ago I was thinking about what would an ideal scripting language would look like.

      The first thing I'd like are some of my favorite features from Common Lisp, like first class functions, ability to do procedural, functional, and object oriented programming with the same language, dynamic typing, macros, closures, and lexical scoping.

      Having a C-like syntax would be good for people who are used to C or Perl and don't want to learn about s-expressions. Automatic memory management is a must.

      So I was thinking about how much work it would take to implement something like that, and I realized that Javascript has just about every one of those features, although some are implemented in odd ways. The scoping rules are a bit strange, and the "this" operator is handled poorly, IMHO, but everything else is almost exactly what I'd want.

      I think Javascript gets a bad rap because you have to worry about browser compatibility. But if you ever use it while only targetting a single browser, it's a dream to work with, and all of the annoyances go away.

      And it's much more powerful than I used to think, before I started working on my now half-finished Javascript app. (Shameless plug there.)

      --
      If moderation could change anything, it would be illegal.
    16. Re:The more I learn about JavaScript... by misleb · · Score: 1

      I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point.


      Um, you understand that GWT is not a language, it is a framework, right? Java is the language. And JavaScript is most CERTAINLY not more powerful than Java.

      I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.


      Don't give in to the temptation because it would make you look quite foolish.

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    17. Re:The more I learn about JavaScript... by plams · · Score: 1

      I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point. I think "the point of GWT" is clearly stated on their front page. The ability to write your web application more like a real application. The ability to share client and server side code. The possibility of using a real debugger. Support for browser history (havn't seen this for AJAX before).. just to name a few.
    18. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      It ran on a proprietary webserver.

    19. Re:The more I learn about JavaScript... by Bluesman · · Score: 1
      "I like Javascript, but it has the same problem as PHP: no namespaces."

      You can work around this by writing object-oriented Javascript, like this:

      function myNamespace()
      {
       
      }
       
      myNamespace.prototype =
      {
        var1: null,
        var2: null,
       
        func1: function(){alert('yay');},
      };
       
      myObject = new myNamespace();
      The only problem you run into is if you want to call a member function as a result of an event. I haven't found a good way to do this without using some sort of global variable or function, because of the brain-dead way "this" works in Javascript.

      But the vast majority of namespace problems in Javascript can be solved with this approach.

      --
      If moderation could change anything, it would be illegal.
    20. Re:The more I learn about JavaScript... by misleb · · Score: 0

      I know, for one thing, that JavaScript started out as a horrible little language, and within a year or so, it became a beautiful little language. I imagine that we could do better, were the same thing attempted today.


      What more do you expect to get from JavaScript? The simple fact is that it lacks some very basic modern OO language constructs such as interfaces, abstract classes, and threads. And by the time you add those in, you'll just have reinvented Java. So what would be the point?

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    21. Re:The more I learn about JavaScript... by multipartmixed · · Score: 1

      > Rhino compiles down to Java bytecode which is then JITed by the JVM. If you want performance, use Rhino

      Now that IS interesting, I wasn't aware of that. Thanks!

      ATM, Spidermonkey seems to perform VERY well for my needs. I have used NJS in the past and been satistfied with it (from a speed perspective) as well.

      Of course, when I profile my javascript code... only a VERY SMALL amount of time is spent in the JavaScript interpreter. Wall time is mostly consumed doing pesky things like I/O. So I tend to concern myself, first and foremost, with correctness and ease-of-coding. Spidermonkey's guts are a little heady but not really all that bad. Design-type comments would be nice, though. ;)

      I may change my tune later this month, however, when I try to write multithreaded JavaScript programs.

      Have you ever seen C libs embedded in Rhino, maybe built with gcj? I'm no Java guy but I have written enough JNI crap that I could probably cobble together an interface between Rhino and my backend C libs.

      --

      Do daemons dream of electric sleep()?
    22. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      Let the Google Masturbation begain...

    23. Re:The more I learn about JavaScript... by multipartmixed · · Score: 1

      > I think Javascript gets a bad rap because you have to worry about browser compatibility.
      > But if you ever use it while only targetting a single browser, it's a dream to work with,
      > and all of the annoyances go away.

      I use JavaScript frequently, and have for years. I don't write much for the browser any more, but I often use JavaScript for general purpose projects.

      I'm a hardcore C hacker, know enough LISP to write macros for emacs, and I totally agree with your assessment. About the only thing I REALLY don't like is the way it handles inheritance and class hierarchies. I think Smalltalk did a better job there.

      I suppose constants and macros would be features worth adding, too... but then, some of the macros I have seen in C make me wish they had never been invented.

      But the S-expression-like syntax in JavaScript (var a = {prop: value, prop2: value2}) totally rocks. As do the scoping rules, WITH THE EXCEPTION of it's idiot rule of "oh-its-not-initialized-so-lets-make-it-a-global". I would prefer an error.

      Oh, and vian looks neat! Ever thought about writing something like dialog/xdialog/cdialog for the browser? You could use your same screen interface. I think that would be awesome.

      --

      Do daemons dream of electric sleep()?
    24. Re:The more I learn about JavaScript... by Abcd1234 · · Score: 1

      I realized that Javascript has just about every one of those features

      Funny thing is, so does, say, Perl (probably to an even greater degree... how do you do macros in Javascript? I know Perl allows script pre-processing modules). However, both language suffer from a flaw that I think makes it difficult to write large scale applications: weak typing. Dynamic typing, that kicks ass, absolutely. But *weak* typing creates a whole class of errors easily avoided with a strong type system, just so the programmer can be a little more lazy. But, IMHO, the benefits don't outweigh the risks.

      Personally, I much prefer something like Smalltalk (no, not Ruby... Ruby is just a weak attempt to replicate Smalltalk, and they did a crappy job of it). And transforming Smalltalk into a scripting language would be pretty easy, I think...

    25. Re:The more I learn about JavaScript... by Abcd1234 · · Score: 1

      First, Javascript is a horrendous language. It is full of unexpected quirks, and compared to other dynamic languages such as Python or Ruby it is hell to work with.

      Would you care to explain? I've used all of these languages to some degree, and Javascript seems no better or worse than the others (well, depending on your preferences... Python and Ruby are both dynamically, strongly typed, and Javascript is dynamically, weakly typed. If you're prejudiced against the latter, then of course you'll prefer the former).

    26. Re:The more I learn about JavaScript... by anomalous+cohort · · Score: 1

      In JavaScript you find all errors at runtime

      This may be more of a DOM issue than a javascript issue but I find a lot of situations where you don't get an error at all. It just doesn't do what you instructed. Sometimes execution just halts in that method and sometimes it doesn't.

      Also, don't get me started on javascript's this variable which is a complete joke.

    27. Re:The more I learn about JavaScript... by skidv · · Score: 1

      Do you think that the new
      Java 7 Kernel will actually make javascript faster to execute? Sun claims that it will because it only loads the classes it needs. Care to comment?

    28. Re:The more I learn about JavaScript... by Gospodin · · Score: 2, Informative

      Not. Java doesn't have closures. Java functions aren't first-class objects.

      JavaScript, OTOH, isn't typed.

      There's loads of differences between them. All I'd want from JavaScript is more performance, namespaces, and possibly some very basic native OO concepts so that I can define an inherited class without three or four declarations and maybe have private and static members.

      --
      ...following the principles of Heisenburger's Uncertain Cat...
    29. Re:The more I learn about JavaScript... by Bluesman · · Score: 1

      I haven't considered doing xdialog in the browser, but it's a good idea. Vian came out of a desire for a web-based unix environment. The next step is a command shell, which can use the same editor/cursor class that vian uses, so it should be very easy to do.

      I think the coolest thing potentially is being able to send the commands to a real unix server and then pipe the output back to the Javascript shell. Obviously this has potentially serious security implications, but with a secure setup could be extremely useful.

      --
      If moderation could change anything, it would be illegal.
    30. Re:The more I learn about JavaScript... by mpcooke3 · · Score: 1

      I'm not really sure I see the point of GWT

      Millions of dollars and 5 years of Java IDE development by some of the best IDE developers in the world. Also the Hotspot JIT Compiler and class libraries.

      There are many 'languages' that Java developers would probably prefer to use if they had had the same massive cross-industry investment as Java - like Ruby, Python or Smalltalk.

      Matt

    31. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 1

      Do you think that the new Java 7 Kernel will actually make javascript faster to execute?

      I suppose it depends on whether the price of orange juice directly affects the outcome of soccer games played in the Miami Orange Bowl.
    32. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 1

      Have you ever seen C libs embedded in Rhino, maybe built with gcj?

      I'm not really sure what you're asking here, so I'll just give a generic answer. Rhino compiles scripts to Java classes based on Rhino's hashtable-like data-model classes. Java classes can be passed to Rhino either by extending/implementing the data-model classes, or by using the Livescript-like Javascript APIs.

      Native libraries are incompatible with Java save for when they are mapped to a class through JNI. So if you want to link in a library, make a JNI wrapper. Before you do that, though, make sure there isn't a Java library that already does what you want. There are very few things above the level of a system driver that Java does not have a cross-platform library for.
    33. Re:The more I learn about JavaScript... by ispeters · · Score: 2, Informative

      The more I learn about JavaScript, the more I like it as a language.

      I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point.

      I agree with you that Javascript is a nicer language than Java and more powerful to boot, but I'm using GWT for one big reason: dead code elimination. The GWT compiler takes advantage of the static analysis possibilities in Java and the closed-world nature of a web page and produces dramatically optimized Javascript. The resulting code is obfuscated, which reduces download time, and has all the dead code eliminated, which reduces download time. Also, for broken interpreters, like the one in IE, a smaller script executes faster, on top of downloading more quickly.

      I guess what I'm saying is that GWT brings a compiler to Javascript and that has many benefits. For the GWT compiler, Java is to Javascript as C is to assembler in a C compiler. Generally speaking a C compiler produces better machine code than someone writing assembler by hand. The same is true for the GWT compiler--its output runs faster than a comparable programme hand-written in Javascript.

      Ian

    34. Re:The more I learn about JavaScript... by misleb · · Score: 1

      Ok, that stuff would be great for better client side programming, but I don't see any point in trying to turn JavaScript into a full server side language. Where there are already languages such as Python or Ruby that do what you want.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    35. Re:The more I learn about JavaScript... by Gospodin · · Score: 1

      I agree, Javascript is fine as a client side language only. My point wasn't that we need to turn it into a server side language (although this is already being done in a proof-of-concepty way, so it's sort of too late to make this point), but rather that improving Javascript isn't going to magically turn it into Java.

      --
      ...following the principles of Heisenburger's Uncertain Cat...
    36. Re:The more I learn about JavaScript... by larry+bagina · · Score: 1

      function.call and function.apply let you tweak this. Wrap it in an anonymous function and your problem is solved.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    37. Re:The more I learn about JavaScript... by larry+bagina · · Score: 1
      Most javascript complaints are along the lines of:

      • overlaoded + (addition, string concatenation) is confusing (aka you're an idiot and shouldn't be programming)
      • IE/DOM/Event handling quirks (not an issue of the language itself).
      • Numbers are always floating point (valid).
      Personally, I consider javascript to be a better designed language than php.
      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    38. Re:The more I learn about JavaScript... by Bluesman · · Score: 1

      Thank you, that's a big help. This is going to simplify a lot of things for me.

      --
      If moderation could change anything, it would be illegal.
    39. Re:The more I learn about JavaScript... by larry+bagina · · Score: 1

      Spidermonkey's guts are a little heady but not really all that bad. Design-type comments would be nice, though. ;)

      I think the spidermonkey code is a mess... Try taking a look at kjs/WebKit JavaScriptCore. It's much cleaner and (imo) easier to add new native functions/classes.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    40. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      JavaScript is most CERTAINLY not more powerful than Java.

      Err, think again.

      Where are the closures in Java? Anonymous functions?

    41. Re:The more I learn about JavaScript... by fredrik70 · · Score: 1

      already done actually, you can use jscript as your server side language on on IIS

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    42. Re:The more I learn about JavaScript... by Anonymous Coward · · Score: 0

      Majorbugger compared javascript to ruby and python.
      Of course, javascript is better than PHP, but it tells more about the weakness and crapiness of PHP than the qualities of javascript.
      Being better than PHP is not something to be proud of.

    43. Re:The more I learn about JavaScript... by fredrik70 · · Score: 2, Insightful

      javascript is a prototype based language, rather than class based (although you can simulate it quite nicely).
      more info here

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    44. Re:The more I learn about JavaScript... by fredrik70 · · Score: 1

      I know someone replied to your 'this' problem. You can also check out mochikit, they got a great bind() metoth which let's yuo 'set the this pointer, also, they got 'bindMethods()' which binds all methods of an object ao that objeect always is the this pointer, very neat. also other goodies like partial functions, map(), filter(), standardised event handleing over ie and ff (look a bit like Qt event handling) and more for you to play with - lovely stuff

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    45. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      It is full of unexpected quirks, and compared to other dynamic languages such as Python or Ruby it is hell to work with.

      I'll bet you just don't know how to work with it. Go read Douglas Crockford.

      There are a few quirks, here and there, that I really don't like, but they are things I can live with. As the sibling asked, could you be specific?

      The power of GWT and similar frameworks is that they provide ready to use components which render similarly across all browsers, making it feasible to prepare a fully functional and nicely lookung web UI in a matter of minutes.

      In other words, just like Dojo, Mochikit, Yahoo Web Toolkit, and other JavaScript libraries, only instead of using a nice, clean, powerful language (Javascript), you're forced to use a verbose, restrictive, backwards language (Java), which just compiles to Javascript anyway, resulting in bigger and slower Javascript code.

      --
      Don't thank God, thank a doctor!
    46. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      This may be more of a DOM issue than a javascript issue but I find a lot of situations where you don't get an error at all. It just doesn't do what you instructed. Sometimes execution just halts in that method and sometimes it doesn't.

      You want a good debugger. Or, hell, just look at Firefox's error log -- it'll show you errors in HTML and CSS, also.

      Also, don't get me started on javascript's this variable which is a complete joke.

      It's completely easy to work around, also. Would you care to explain what about it is a problem?

      --
      Don't thank God, thank a doctor!
    47. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      In JavaScript you find all errors at runtime, in Java you can catch many at compile time.

      So what?

      Most of the errors I catch at compile time in languages like Java are things that would not be errors in languages like Javascript. And in any case, what is so magically better about compile time?

      Differences in browsers object models makes it counter-intuitive to write cross-browser JavaScript code, GWT can take care of these differences for you.

      So can Dojo, the Yahoo UI library, and so on. I understand the need to have a toolkit, I just don't understand why you'd want a toolkit that forces you to use Java code instead of Javascript.

      --
      Don't thank God, thank a doctor!
    48. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Um, you understand that GWT is not a language, it is a framework, right? Java is the language. And JavaScript is most CERTAINLY not more powerful than Java.

      Really? What features are missing from Javascript that are in Java?

      Because I could come up with a very long list of things that are nowhere to be found in Java, but are actually cleverly hid in Javascript.

      Don't give in to the temptation because it would make you look quite foolish.

      Only because it's been done already.

      However, you just claimed Java is more powerful than Javascript, and I think that makes you look quite foolish. Javascript is lisp in C's clothing, much like Ruby -- and I think most of us can agree that Lisp is MUCH more powerful than Java will ever be.

      --
      Don't thank God, thank a doctor!
    49. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      The simple fact is that it lacks some very basic modern OO language constructs such as interfaces

      Not needed in a dynamically-typed language.

      abstract classes

      See above.

      and threads

      That's a property of the interpreter, not the language.

      And by the time you add those in, you'll just have reinvented Java.

      Really? So Java has anonymous subroutines, anonymous classes, classes/objects/functions/methods all as first-class variables, closures, dynamic typing, the eval() keyword, and the ability to add stuff to existing classes without subclassing?

      ...Need I go on?

      Go read Douglas Crockford. Until then, you don't really know Javascript.

      --
      Don't thank God, thank a doctor!
    50. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      The Mozilla Rhino Javascript Engine actually compiles the JS down to Java byte code. That wouldn't be all that special, except that the JVM then JITs that to native code. Which means that Javascript doesn't have to be slow.

      How fast is it, really? Compiling down to Java bytecode doesn't necessarily make it faster.

      Consider a Bash script -- for most of what people use Bash for, you're not going to get any significant speed improvement out of "compiling" it, if you could.

      I think JavaScript could be very fast, but I haven't seriously looked at Rhino, so I don't know if it's actually a real improvement, or if it's just "compiling" similar to how Bash "compiles". Or if it's an improvement, but still slower than other languages.

      --
      Don't thank God, thank a doctor!
    51. Re:The more I learn about JavaScript... by Abcd1234 · · Score: 1

      Well those are hardly major complaints. Overloaded +, yeah, I agree that's a bad idea, particularly in the face of weak typing, but it's a minor wart. Numbers always being floats? Plenty of languages have automatic type promotion, so it's not *that* much worse than, say, Python (though, I agree, it does make this a little more cumbersome).

      But again, I see nothing here that suggests Javascript is any worse than Ruby, Python, Perl, or any other scripting language out there, unless you simply object to dynamic, weakly typed languages (and it's interesting that the OP has yet to respond to my original question). Heck, I'd claim that, as far as dynamic, weak languages go, Javascript is pretty nice... clean, simple syntax. Consistent, powerful object model. A nice mix of OO and functional paradigms. IMHO, it's biggest wart is lack of namespaces (though that can be hacked around with some object trickery).

    52. Re:The more I learn about JavaScript... by anomalous+cohort · · Score: 1

      You want a good debugger. Or, hell, just look at Firefox's error log -- it'll show you errors in HTML and CSS, also.

      A good debugger does help but I have run into situations where javascript errors did not generate anything in FF's error log. Also, I end up having to debug my javascript in both IE and FF in order to make sure that it works in both browsers.

      It's completely easy to work around, also. Would you care to explain what about it is a problem?

      If you create an object and call a method on that object, then the this variable within the scope of the method refers to the object whose method has been called. However, if you set that method as the target to an event and that event gets fired, then the this variable within the scope of the method refers to the object that fired the event. I realize that there are libraries (e.g. prototype binding) that get around this but the fact that you have to use a library for a properly working this variable reflects poorly on the language.

    53. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      And in any case, what is so magically better about compile time? The faster you find and fix errors the more productive you are. In a Java IDE like Eclipse, you find lots of errors while you're typing in your code. You get code completion. Hyperlinks to documentation. Hyperlinks to source code implementations. You can see the types of all arguments to functions, which makes it easier to reason about code. Refactorings like rename are a trivial operation.

      I've used both dynamic and statically typed languages, and I find dynamic languages end up slowing me down. Static types are just too useful. I acknowledge there are some benefits to dynamic typing and some downsides to static typing, but there will always be tradeoffs.
    54. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Also, I end up having to debug my javascript in both IE and FF in order to make sure that it works in both browsers.

      Maybe I'm just naive, but I haven't found many places where the Javascript implementation itself is any different in IE. The DOM and various APIs, sure, but once you've abstracted those away in a (very small) library, you're done -- you can develop in Firefox and deploy in IE.

      If you create an object and call a method on that object, then the this variable within the scope of the method refers to the object whose method has been called. However, if you set that method as the target to an event and that event gets fired, then the this variable within the scope of the method refers to the object that fired the event.

      That's not a bug, it's a feature, although perhaps not a very commonly-used one...

      I haven't tested it, but I believe you can do something like: foo.method = bar.method

      That's kind of a Ruby pattern -- mixins.

      As for the workaround, like I keep saying to everyone, read Douglas Crockford. If you don't like which "this" is being used, you can always reassign it with: var that = this

      Because Javascript supports closures, the "that" variable will always be available through the scope in which you defined your method. It makes it very easy to explicitly define which object you're talking about, even if you end up defining other singleton objects within your main class/constructor.

      I realize that there are libraries (e.g. prototype binding) that get around this but the fact that you have to use a library for a properly working this variable reflects poorly on the language.

      I disagree -- the fact that you can use a library to fix something you don't like about a language demonstrates just how powerful it is.

      In other words: Javascript is quirky, and this is to be expected, given its history. But just about every single one of those quirks that's actually a problem can be worked around within the language itself, and you can put those workarounds in a library. Not many other languages can do that.

      --
      Don't thank God, thank a doctor!
    55. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      In a Java IDE like Eclipse

      That's not compile time, that's IDE time. In which case, you can use Eclipse for Javascript. I believe Aptana is a variant of eclipse specifically designed for this.

      You can see the types of all arguments to functions, which makes it easier to reason about code.

      I just don't find this to be true at all. Maybe I think a different way, but it was a breath of fresh air when I discovered that I no longer had to care about the type of a given object, argument, or whatever. I never really found types useful, just one more thing I had to keep track of -- kind of like memory management. It's just nice to be able to work in a garbage-collected language.

      --
      Don't thank God, thank a doctor!
    56. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      Because I could come up with a very long list of things that are nowhere to be found in Java, but are actually cleverly hid in Javascript. In this thread you've made statements along the lines that features which are lacking in Javascript can be mimicked with hacking. Well guess what, the same goes for Java. Want dynamic typing? Want to extend your class at runtime? Want higher order functions or closures? Then use some hashtable hackery with anonymous classes, casts, reflection, etc. You can break out of the type system if you want to.

      Now you'll cry out that all these features aren't conveniently built into the language. The same goes for the features Javascript lacks. Language design is all about tradeoffs. There isn't some magical "power" number you can ascribe to them, especially when they're Turing complete.
    57. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      In this thread you've made statements along the lines that features which are lacking in Javascript can be mimicked with hacking.

      The kind of hacking I'm talking about is actually intentional to the language. It's convenient, easy to do, and makes sense.

      But as far as I'm concerned, by the time we're talking about reflection, it's more than just "not built-in", we're getting into the realm of "Well, you can do anything you want, as long as you write a preprocessor..." In other words, at this point, the distinction becomes kind of meaningless, because you can compile Java into Javascript (GWT), and vice versa (Rhino).

      Compared to, for example, the claimed lack of namespace -- that can be done so easily it may as well have been a language feature.

      Language design is all about tradeoffs.

      That much is true.

      There isn't some magical "power" number you can ascribe to them, especially when they're Turing complete.

      Turing-completeness has nothing to do with power. It would be difficult for me to define what I mean by "powerful", but I think we can all agree that assembly language isn't particularly powerful, and neither is Basic.

      Where I find a lack of power, where I find places where I say "This feature isn't in the language," is when you have to actually tie yourself and your code in knots to pretend a feature is there when it's not -- when there's no syntax for it, and no easy way to derive the feature from existing syntax. Reflections don't count any more than writing an interpreter in your language does -- for example, Rhino does not prove that Java is as powerful as Javascript (even if Rhino targeted Java directly; it targets bytecode).

      Where I find an abundance of power is in places where it's easy and natural to extend a language, or where useful patterns are available within a few lines of code. Just about everything I was missing in Javascript can be added in less than ten lines of code -- of Javascript code -- or in two and there line patterns. I haven't used Java reflections, but I doubt it's anywhere near that easy.

      One example of a feature that's actually missing from Javascript is the ability to support true integers. Hacking around it won't make it actually use integers at the interpreter level, and your hacks would be fairly ugly. I don't run into this often in practice, though -- rounding a float is easy enough, if I need to.

      Another example is foreach loops. Javascript does have them, but the syntax is annoying -- I get the index, not the value, meaning I can't do this with anonymous arrays. I may be able to work around this later, though -- I imagine it won't be hard.

      And then there's + for concatenation, and things like that.

      But these are not things that actually make me pull my hair out and refuse to work in a language. Java's explicit exception re-throwing does, along with other verbosity.

      --
      Don't thank God, thank a doctor!
    58. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      That's not compile time, that's IDE time. In which case, you can use Eclipse for Javascript. But it works by compiling while you're typing. I don't see how a Javascript plugin for Eclipse can give you the same benefits you get in Java without static type information. I went to the home page for Aptana and it seems like it has built-in knowledge for standardized things like CSS properties, but not the code you are writing.

      I never really found types useful, just one more thing I had to keep track of -- kind of like memory management. I find this hard to believe. I've seen enough dynamically written code to know that the types are there, but latent. For example, if a method takes a "foo" argument, the method is written with knowledge of what a foo is. Look at the API for something like Ruby on Rails. It's chock full of types, and if you're calling some method you'll want to know the types of arguments it expects. So you'll have to infer it by the name, documentation, or reading the implementation. With Java and Eclipse I can find out what I need to know with a simple click.

      As for your comparison to garbage collection, I'm glad you made that analogy. The garbage collector is keeping track of memory for you, and you say "It's just nice to be able to work in a garbage-collected language." And I say it's nice when the compiler keeps track of types for me! That's why I get immediate error detection while I'm typing, code completion, and hyperlinks to code and documentation.

      Now, Java's implementation of static typing is incredibly verbose and tedious. But there are much better statically typed systems that infer the type for you, so you don't have to write it out all the time.
    59. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      I've seen enough dynamically written code to know that the types are there, but latent. For example, if a method takes a "foo" argument, the method is written with knowledge of what a foo is.

      Not entirely true. It's not the types that are there, it's the interfaces.

      For example: Consider Javascript's alert function. It only needs an object that has a toString method. In fact, it can take any object, because Object has a toString method. The only way it wouldn't work is if you deliberately overrode toString with something that's not a method.

      I know Java has similar things -- it has Interfaces, with a capital I, which is a way of getting around Java's lack of multiple inheritance. So in Java, you would have to define a "Stringable" interface, which defines what a toString method looks like. It's a nice way of forcing people to write documentation, and it does improve compile-time checking, but that's all.

      In Javascript, I can just define toString and use it. I don't have to define some complex system of interfaces and inheritance just to make sure that by the time I pass in an object that I already know will work in this case, the compiler agrees with me that it will work. Instead, it's just a matter of "Does foo have a toString defined? Yes? Ok, I assume you know what you're doing."

      And I say it's nice when the compiler keeps track of types for me!

      So do I -- which is why I don't like Java. Java forces me to keep track of the types myself, verbosely. At least the compiler will make sure I'm doing it right, most of the time -- which is basically like running my C/C++ program through Valgrind looking for memory leaks.

      And I like Javascript because I don't have to know about types anyway. It doesn't care what type something is, only what it can do.

      But there are much better statically typed systems that infer the type for you, so you don't have to write it out all the time.

      In which case, it gets closer to a dynamically-typed language. And if you don't have to write it out all the time, it also gets rid of your "find everything you need with a simple click" advantage.

      Javascript is actually not my ideal language -- really, it sucks. But all languages suck. My ideal language doesn't exist yet, and it would also be a very tough one to write.

      --
      Don't thank God, thank a doctor!
    60. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      But as far as I'm concerned, by the time we're talking about reflection, it's more than just "not built-in", we're getting into the realm of "Well, you can do anything you want, as long as you write a preprocessor..." Reflection isn't hard, and it's built into the language.

      Compared to, for example, the claimed lack of namespace -- that can be done so easily it may as well have been a language feature. But it wasn't, and so ad-hoc solutions are proposed, which breaks down when you try to compose 3rd party libraries. It sure is nice having it built-in from the start.

      Turing-completeness has nothing to do with power. It would be difficult for me to define what I mean by "powerful", but I think we can all agree that assembly language isn't particularly powerful, and neither is Basic. Other common terminology is "expressive" and "higher-level". I know what you mean -- doing more with less in a natural manner. However what you gain via dynamic hacks you lose in explicitly expressing your abstractions. Take "goto" as an example. In one sense it is low-level, but in another sense it is powerful. It has been replaced by higher-level structural programming, but goto is powerful enough to implement all that stuff, and quite useful and natural when breaking out of some nested code.
    61. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      It's not the types that are there, it's the interfaces. Interfaces are a subset of types.

      And I like Javascript because I don't have to know about types anyway. It doesn't care what type something is, only what it can do. But of course you care! You have to know that alert() takes an object with toString() defined. That's type information. alert() is a cherry-picked example anyways -- it is simple and ubiquitous. Look at all the methods in the Rails documentation I linked to in my previous post. Are you honestly telling me that you don't have to care about types when calling those methods?

      In which case, it gets closer to a dynamically-typed language. And if you don't have to write it out all the time, it also gets rid of your "find everything you need with a simple click" advantage. Nope. It works as if I had written it out. The compiler knows the types by inferring them. Wikipedia has an entry on it.
    62. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Reflection isn't hard, and it's built into the language.

      So implement closures with reflections... Not so easy, is it?

      However, implementing namespaces in Javascript is natural and easy.

      But it wasn't, and so ad-hoc solutions are proposed, which breaks down when you try to compose 3rd party libraries. It sure is nice having it built-in from the start.

      In other words, you'd prefer a language that forces best practices onto you, so that everyone will use them, than a language which lets you do whatever you want, including best practices?

      I prefer flexibility. I think it's easier to build a restrictive subset of a flexible language than it is to tack on flexibility to a restrictive language.

      Also: If you make the base language too restrictive, you'll always find people willing to use another language, just to avoid working in yours. And this will be true of libraries, as well.

      However what you gain via dynamic hacks you lose in explicitly expressing your abstractions. Take "goto" as an example. In one sense it is low-level, but in another sense it is powerful.

      Ah, but goto is actually harmful -- it produces extremely buggy, error-prone code. Breaking out of nested code is better handled by things like exceptions and loop labels, and I really can't think of any other legitimate uses of goto.

      At the same time, I can see a language that included goto, and then built other, higher-level structures as part of a standard library which wrapped around goto.

      However, these namespace "hacks" do produce good, readable, re-usable code. I'd even argue that it's more re-usable than a static definition of a "namespace". Wrap it in a library, and you have the option of building development suites which understand that library, thus understanding your higher-level abstractions.

      Easier to build from a flexible language than to bend an inflexible one.

      --
      Don't thank God, thank a doctor!
    63. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      But of course you care! You have to know that alert() takes an object with toString() defined. That's type information.

      True enough. I know that because I read the alert() documentation.

      alert() is a cherry-picked example anyways -- it is simple and ubiquitous

      And anything with documentation is going to be able to tell me what the type is.

      I know Java has the type right there in the argument list. However, I still have to go look up that list (the method signature), and I then have to go look up what each of those types actually is.

      Are you honestly telling me that you don't have to care about types when calling those methods?

      Be more specific. Looking at a few random ones, I only saw various strings, or occasionally a hash table of strings, so no, not much type information to care about here.

      Nope. It works as if I had written it out. The compiler knows the types by inferring them. Wikipedia has an entry on it.

      The sad fact is, even C++ has more type inference than Java. Among other things, it doesn't force me to declare "throws IOException" on absolutely every function that might, however indirectly, touch IO.

      Yes, I have actually used Java for a bit more than a "Hello World" program. I still don't like it.

      --
      Don't thank God, thank a doctor!
    64. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      And anything with documentation is going to be able to tell me what the type is. And in Ruby you have to manually dig out the documentation. In Eclipse it's all there with a click. I get code completion. I get type errors while I'm coding. It's compiler checked documentation that helps me reason about code.

      Be more specific. Looking at a few random ones, I only saw various strings, or occasionally a hash table of strings, so no, not much type information to care about here. How do you even know that they are just strings or a hashtable of strings? That, in and of itself, is type information.

      The sad fact is, even C++ has more type inference than Java. Sure, but the point is that there are languages like Scala that work on the JVM, have closures, first class functions, etc., and are also strongly typed with support for type inference. So if the question is "why not Javascript?", my answer will be "why not Scala?"
    65. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      So implement closures with reflections... Not so easy, is it? Implement a type system in Javascript that gives me the power of Eclipse. Not so easy, is it?

      I prefer flexibility. I think it's easier to build a restrictive subset of a flexible language than it is to tack on flexibility to a restrictive language. I prefer a language that is practical and makes it as easy as possible to use 3rd party libraries together. Take Scheme, for instance. That was the language out of which all the "Lambda the Ultimate" papers came out of, a language that prides itself on minimalism. Just a few days ago the new version of Scheme was ratified. It was something of an identity crisis for Scheme. There are lots of problems writing portable, composable code in Scheme, and the new version tried to address it, but at the cost of flexibility and simplicity.

      Will Clinger's apology is an interesting read. In it he describes first why he is going to vote yes (he later votes no because of last minute changes), and this is from the guy known for the quote: "Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary."

      Quote from the above apology: "When evaluating the R6RS, I look at it as a programmer who has written, is maintaining, and wants to write more portable programs and libraries in Scheme. [...] The proposed R6RS offers improvement in several areas where absent or weak or incompatible standards have been making it unnecessarily difficult to write portable programs and libraries."
    66. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Sure, but the point is that there are languages like Scala that work on the JVM, have closures, first class functions, etc., and are also strongly typed with support for type inference. So if the question is "why not Javascript?", my answer will be "why not Scala?"

      At the moment, the JVM is still unbearably slow to start, and has just been bloated and not entirely portable, in my (limited) experience. (As an example, we complain about having no 64-bit support for Flash, but there's no 64-bit browser plugin for Java, either.)

      --
      Don't thank God, thank a doctor!
    67. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      I'm not arguing for the JVM to replace Javascript on the browser. In the context of GWT, I'm arguing why I would choose a language like Scala on the server side to generate my Javascript for me.

    68. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      I'm not arguing that either.

      I do believe, however, that it's possible to create a common runtime, and maybe even a common language, for all general purpose tasks.

      Yes, ALL. Embed it in the browser, write the browser in it (and the webserver), write little scripts to run your system, use it as a command shell, use it to write games or OS kernels...

      Basically, use it for anything that doesn't almost physically force you to use a language like Assembly or the GL Shading Language.

      So, I keep running into languages that come up short in some ways. You've pointed out some problems with Javascript, and I could probably find a few more. I've pointed out some problems with Java, and the JVM -- and we know that any Javascript or Ruby runtime would likely be slower than any Java runtime, for long-running tasks.

      The problem is, I haven't found a single language that I would use for every single one of these things. In fact, pretty much all of them fail at either being faster than C or being able to at least pretend to be interpreted (for an interactive shell/console/debugger, for example -- I know C++ has a debugger, but can I just arbitrarily change the class definition in mid-program?)

      I was even open to weird syntax like Erlang or Haskell, but those have weird performance issues. Erlang also pretty clearly illustrated my point by providing the option to compile something or just run it -- I don't remember if this is a choice between bytecode and native, or between bytecode and interpreted. I do remember that the "compiled" version could not allow you to dynamically reload a given function, which is one of the killer selling points of Erlang -- being able to update your program, in many cases without even restarting it, because you can dynamically replace functions so easily. (Easier than Reflections, I'd bet, but I don't know Reflections.)

      Perhaps the closest, when I lower my standards enough, is Python. It's been long enough since I've used it that the syntax looks clean, it has a reasonably fast implementation, with the promise of faster-than-C with projects like Psyco and PyPy, and it's got very cool things like continuations that make threading just mindlessly simple.

      But the GIL just kills it. I really don't see a way to implement Python properly, and have it scale to multiple cores.

      And at this point in my life, I don't really have the time to get started on a project like a new language/runtime, and I don't know enough, particularly about the low-level concepts I'd need. But if there's enough interest, or if there's a project that's close enough, I'd like to help out, at least with testing.

      --
      Don't thank God, thank a doctor!
    69. Re:The more I learn about JavaScript... by anomalous+cohort · · Score: 1

      In other words: Javascript is quirky, and this is to be expected, given its history. But just about every single one of those quirks that's actually a problem can be worked around within the language itself, and you can put those workarounds in a library. Not many other languages can do that.

      Actually, every single dynamic language can do that. That really is the crux of your argument. It's not so much that javascript is good or bad as it is that dynamic languages are better than static ones. I don't have a strong opinion either way. There are advantages and disadvantages with both.

      I don't really have an argument against javascript, the language. It's how javascript is implemented in the web browser that I am unhappy with. Can I live with it? Sure. Do I see room for improvement? You bet!

    70. Re:The more I learn about JavaScript... by Raenex · · Score: 1

      Yes, ALL. Embed it in the browser, write the browser in it (and the webserver), write little scripts to run your system, use it as a command shell, use it to write games or OS kernels.. I sympathize with this point of view, but I think being comparable to C speed is a pretty hard sticking point. Having a language like Python be faster than C is a pretty lofty goal. I'd love to see it accomplished, but I'm skeptical.

      Also, static vs dynamic typing is another sticking point. I know there is research being done to get the best of both worlds, but it's hard. There's no way a general purpose language will take over the world if it only appeals to one side.

      Despite all that, I think it's a very interesting time for language development. There are lots of languages blooming with neat ideas. I just don't see any on the horizon that fit the bill of being high-level, C-fast, and a satisfying mix of dynamic and static capabilities.

      Anyways, it was nice talking to you. Good luck on your langauge search.
    71. Re:The more I learn about JavaScript... by SanityInAnarchy · · Score: 1

      Having a language like Python be faster than C is a pretty lofty goal. I'd love to see it accomplished, but I'm skeptical.

      Well, there are actually reasons this might happen.

      I wrote a long explanation about high-level versus low-level, about why C is better than ASM and why Java is occasionally faster than C (no, really), but I decided I wanted to keep this as short as possible, so here it is:

      psyco was a JIT compiler for Python bytecode. I say "was" because it's x86 only, not even any 64-bit support, and is being replaced by pypy, which is a variant of Python written in Python, and which hopes to duplicate some of the work of psyco in a more portable way.

      What psyco did that's interesting is, unlike other JITs, it would often compile multiple versions of a particular bytecode, and choose which one to use based not on some programmer's idea of which is "more optimized", but by looking at the actual workload the program was facing.

      In short, there are optimizations that it is only possible to make at runtime, which means C will never be able to implement them. A C program might, just as there's a C library for garbage collection, but it would always be tacked on.

      I did talk to someone about this. He was working on a similar project. However, he almost scoffed at the idea of "faster than C" as being too low of a goal, because even at a low level, there are things C compilers just don't do, even if they should be able to.

      Also, static vs dynamic typing is another sticking point. I know there is research being done to get the best of both worlds, but it's hard. There's no way a general purpose language will take over the world if it only appeals to one side.

      Well, being able to behave like one or the other is probably not a solution. It would have to actually be a hybrid of sorts.

      My first instinct, though, is to throw out the static typing, at least as a language feature. Let the language do type inference as best it can, and detect as much as it can at compile time, but if people start doing dynamic things with it, so be it.

      More specifically -- given sufficient type inference and support for advanced OO features like mixins, I think a static language becomes pretty much equivalent to a dynamic language. But that's just types...

      It's about 2:20 AM. I'll have to read this post again in the morning, because what I just said is either very insightful or very stupid, and I can't tell which.

      --
      Don't thank God, thank a doctor!
  3. Just when GWT 1.4 comes out of beta by Anonymous Coward · · Score: 0
  4. the point of GWT by davido42 · · Score: 1, Informative
    "I'm not really sure I see the point of GWT"

    (Disclaimer: I evaluated GWT and decided that it was cool for larger web apps, but for a smallish website I think it is overkill. So.. I'm not a GWT user, sorry.)

    When I was developing my site (which you will visit now and purchase lots of album downloads), I had to deal with the fact that browsers do not implement things consistently. In particular, IE seems to do things differently than every other browser. The idea of GWT is to do all the hard browser bug workarounds and compatibility work for you, so that you write some code in Java and poof! Your web app will look and behave the same across all browsers everywhere. Among the downsides, you have to learn GWT of course, and your resulting code is almost guaranteed to be less efficient and slower to load than if you just code directly in Javascript/HTML/etc.

    In the end, I ditched GWT in favor of simplicity, dealing with IE issues as they arose (my native development platform is Firefox). Then again, my site has very limited functionality. YMMV.

    david

    --

    BitWorksMusic.com -- odd tunes for odd times

    1. Re:the point of GWT by Anonymous Coward · · Score: 1, Interesting

      David --

              Maybe take another look at it. The learning curve is pretty minimal if you a) know java and b) have exposure to any other windowing toolkit, ala tcl/tk, swt, swing, etc. Couple hours tops, honestly. Secondly, the obfustication tech. makes the resulting javascript much smaller than hand-coded javascript, much the same way that a C compiler can write more efficient assembly than you or I could. Finally, I actually found the opposite about app size when I have used it with my customers -- for small apps it is perfect because you can produce a really slick interface very quickly. If you app has a lot of distinct functionality, and maybe parts of it aren't yet ported to GWT (for example) GWT actually gets in your way.

    2. Re:the point of GWT by SanityInAnarchy · · Score: 1

      I had to deal with the fact that browsers do not implement things consistently. In particular, IE seems to do things differently than every other browser. The idea of GWT is to do all the hard browser bug workarounds and compatibility work for you, so that you write some code in Java and poof!

      In other words, it does something like Dojo, Yahoo Web Toolkit, and so on, only in Java instead of Javascript. And Java is, without question, a more restrictive and less powerful language than Javascript.

      --
      Don't thank God, thank a doctor!
    3. Re:the point of GWT by Serveert · · Score: 1

      It is also statically typed. Which means you can find out who calls your method pretty easily in eclipse. Try that with your javascript editor. Or you can set up methods with types, if the method breaks, callees break too. So it scales very well in terms of number of developers. Set up your interface(method) and everyone must use it. I have used GWT and straight Javascript. Coding in Javascript becomes a pain, you don't want to split up your files since that creates browser lag so you usually have one large file with all the Javascript classes. It gets ugly, fast. With GWT, just code all your java classes in separate files, with their own package names, GWT will take care of streaming the javascript intelligently.

      The reason why I prefer YUI right now is it offers more widgets and functionality than GWT. But I keep my eye on GWT, in a year or two, it will have every widget you could want and writing applications with it will be a no-brainer.

      --
      2 years and no mod points. Join reddit. Because openness is good.
    4. Re:the point of GWT by Serveert · · Score: 1

      s/callee/caller

      --
      2 years and no mod points. Join reddit. Because openness is good.
    5. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Which means you can find out who calls your method pretty easily in eclipse. Try that with your javascript editor.

      I must be missing what, exactly, you're trying to do here -- it's really easy to just search for a method name, for one thing.

      If it's more complicated than that, I suppose you could examine the call stack from a debugger...

      Coding in Javascript becomes a pain, you don't want to split up your files since that creates browser lag so you usually have one large file with all the Javascript classes.

      Ok, first off, it seems like it would be really easy to load a bunch of scripts from a bunch of separate files. Just load a bit of Javascript up front that can take care of loading the rest of it on-demand. Hell, even load it with XMLHttpRequest and you can do it asynchronously -- at that point, the only way you have browser lag is if the user limited their number of connections.

      Second, you apparently haven't discovered the wonderful Javascript compiler known as 'cat'. Or, if you want to be really adventurous, use a real "JavaScript Compiler" to combine the files and strip out the whitespace.

      Third, it seems like your main argument against one file is that you like package names. Fine, throw em all in one file and build packages. The only reason one file gets to be a problem is if you're doing a lot of collaboration, and you need people working on different aspects of the project at once.

      With GWT, just code all your java classes in separate files, with their own package names, GWT will take care of streaming the javascript intelligently.

      Not very intelligent if it just pipes it all back in the same response. Really, lots of small files makes sense, for a lot of reasons -- you want everything to be cacheable, but you don't want any one client to have to download any more code than is needed.

      But if that doesn't make sense, it's usually not a big deal to just throw everything in one file, even if you do it with 'cat', then gzip it -- it ends up being really tiny. Just irrelevantly tiny.

      --
      Don't thank God, thank a doctor!
    6. Re:the point of GWT by Serveert · · Score: 1

      I find it interesting in what you leave out. You didn't, exactly, try to address this point. Perhaps I can drag it up. Oh indeed, here it is!

      Or you can set up methods with types, if the method breaks, callees break too. So it scales very well in terms of number of developers.

      Now let's say you have your javascript method that 10 developers call in 20 different ways. Let's say you change that method signature. You have just hosed the code base and pissed off 10 developers, or you can spend 10-30 mins updating all references, hoping you haven't made an stupid spelling mistakes which you would only find at runtime.

      Now let's say we're using GWT. I change the method signature via Eclipse. Eclipse automatically updates all references. 10 happy developers and it took 2 seconds. These are the kinds of things that make big projects run smoothly.

      Second, you apparently haven't discovered the wonderful Javascript compiler known as 'cat'. Or, if you want to be really adventurous, use a real "JavaScript Compiler" to combine the files and strip out the whitespace.

      Cat. Now that was almost witty, in a virginal nerd sort of way. You are very arrogant despite having no real world knowledge of GWT. GWT doesn't dumbly cat together files. It only streams what you need which decreases response time. But if you like latency, cat away. Indeed, you should start with the FAQ on GWT deferred binding. While you cat together 20 language files and send them to the user, your boss just fired you and replaced you with someone who knows GWT. GWT then streams over 1 language file as needed and gets a bonus.

      Your arrogance will get you nowhere except a ditch with no friends and pissed off coworkers. Try using what works, not what your inner egoic fanboi tells you.

      --
      2 years and no mod points. Join reddit. Because openness is good.
    7. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Now let's say you have your javascript method that 10 developers call in 20 different ways. Let's say you change that method signature.

      I'd have to think very hard to come up with a situation in which I have to change a method signature that's already being used by 10 developers, rather than simply making a new method and wrapping it with the old one. Isn't that the whole point of Java "interfaces", to define a public API and then leave it alone?

      You have just hosed the code base and pissed off 10 developers, or you can spend 10-30 mins updating all references, hoping you haven't made an stupid spelling mistakes which you would only find at runtime.

      Or I can use an IDE which supports Javascript -- surprise, Eclipse does! And finding all of the references is as easy as grep -- or if it's not, you have yet to explain why not.

      GWT doesn't dumbly cat together files. It only streams what you need which decreases response time.

      In other words, it "intelligently" cats together files in a way that makes caching impossible. I believe I did address that, while you were busy making jokes about "virginal nerds."

      Oh wait -- you were wrong here. Looking at the actual page, it suggests that GWT simply generates a version of the code for each browser -- which decreases cacheability for proxies, and is also very easy to do with cat. Combine it with make, split browser-specific parts into src/browser/firefox.js and src/browser/opera.js. Done.

      In a well-designed framework, these end up being small enough (1-2k) not to make a difference. And that 1-2k becomes pretty insignificant once it gets gzipped down to a few hundred bytes.

      Fortunately for me, my boss has not drunk the Java kool-aid, so I can afford to make smart decisions here.

      --
      Don't thank God, thank a doctor!
    8. Re:the point of GWT by chillenious · · Score: 1

      I'd have to think very hard to come up with a situation in which I have to change a method signature that's already being used by 10 developers, rather than simply making a new method and wrapping it with the old one. Isn't that the whole point of Java "interfaces", to define a public API and then leave it alone?
      That's funny. Are you dissing refactoring here?
    9. Re:the point of GWT by chillenious · · Score: 1

      And finding all of the references is as easy as grep -- or if it's not, you have yet to explain why not.
      It is not, as you don't have the type info.
    10. Re:the point of GWT by SanityInAnarchy · · Score: 1

      I would call it refactoring to "make a new method and wrap it with the old one."

      It's just the kind of refactoring that doesn't require cooperation from everyone at once, or a massive search/replace through all your code.

      --
      Don't thank God, thank a doctor!
    11. Re:the point of GWT by chillenious · · Score: 1

      Yeah. I'd call it quick fix, but not a solid long lasting solution. But maybe that's just me.

    12. Re:the point of GWT by SanityInAnarchy · · Score: 1

      It's called "backwards-compatibility", and it lasts as long as you care to maintain it.

      Obviously, you should also post something to the changelog/mailing list/whatever letting everyone know what you did, so that they can update their methods on their own. And you can always try removing that wrapper function and seeing if your code runs -- if it's a private interface, that should be the end goal.

      Even in a public interface, that should be the end goal, but I don't think there's much harm in carrying around a wrapper with a big fat "DEPRICATED -- DO NOT USE" sign on it. It lets people's programs keep working for now, while they update it themselves -- you pretty much have to do it this way for public interfaces.

      --
      Don't thank God, thank a doctor!
    13. Re:the point of GWT by chillenious · · Score: 1

      Yeah, I agree. But it's a short term solution. Unfortunately, in my experience, deprecated warnings are often ignored by people, *even* if their IDE warns them. So chances are you end up maintaining a very bloated API, and having to be back wards compatible can be a pain as well that slows you down properly fixing/ improving things.

    14. Re:the point of GWT by Serveert · · Score: 1

      I'd have to think very hard to come up with a situation in which I have to change a method signature that's already being used by 10 developers, rather than simply making a new method and wrapping it with the old one. Isn't that the whole point of Java "interfaces", to define a public API and then leave it alone?

      The point of interfaces is to write something that everyone subscribes to and shouldn't change, but sometimes the interfaces do change. If you are poo pooing refactoring then I hope you're not using the linux kernel which uses refactoring. The Microsoft kernel appraoch does exactly what you describe. Which is why USB operations in windows are slow. Instead of fixing old broken USB code, they patch it up and call the old, broken implementation which is tied to that old interface. In the linux kernel, all references to drivers are updated to the new better, faster way of doing things when the API changes. They break the API, try to compile and fix all references, and you benefit as a result. You poo poo exactly what runs this site, the linux kernel, and probably what you use every day. You don't get the irony now, but someday you will.

      Or I can use an IDE which supports Javascript -- surprise, Eclipse does! And finding all of the references is as easy as grep -- or if it's not, you have yet to explain why not.

      You cannot do this practically with Javascript since any Javascript code over 500 lines ends up using eval. And then execution goes into a black box which cannot be looked at by Eclipse. Or you might at runtime decide to add a method to a JS class if a certain event happens. Eclipse won't pick up that method until the program actually runs. So you will be sitting there looking at your code with a small glimpse of your class, which is worse than having no glimpse of your class. You will get the false notion that you know all the methods of the class when you don't. What makes javascript nice is statically weak typing and dynamic programming. But it's a double edged sword, programs like Eclipse can't inspect javascript code as nicely as they can inspect java code or any other language that is statically typed. Java, on the flipside, doesn't offer the nice type tricks you can do in Javascript. I guess that is what non-fanbois do: recognize weak points / strong points in everything. You on the other hand, wax poetically about the wonders of Javascript. You are a Javascript fanboi. I use Javascript, Java and Python every day, I'm a fanboi of none of these. If someone has a valid reason for Java stinking, I will listen if it's a good point. Same thing for any language. You on the other hand have nothing but a fanboi worker mentality.

      In other words, it "intelligently" cats together files in a way that makes caching impossible. I believe I did address that, while you were busy making jokes about "virginal nerds."

      It caches. The GWT compiler at compile time assembles the JS into different files and decides based on the browser, language, property files, which files to send over. You can of course duplicate this and reinvent the wheel. More power to you. Here is a blurb on how it caches:

      Once the user has downloaded it (which can take a while) it does not need to be downloaded unless there is a new release. The existing program stays in the browser cache and gets used the next time the user goes to your web site. All that gets transferred the next time is a tiny HTML file which is a way of checking whether a new release is available.

      Knowing your fanboi mentality, you will jump on the "which can take awhile" quote. That is what fanbois/corporate types do. You are in the discussion to appease your ego, win the argument, make the boss proud, get promoted, etc. But I have had the pleasure of knowing very well YUI, Dojo. They all have loads of js files to give you despite JS compression.

      Oh wait -- you were wrong here. Looking at

      --
      2 years and no mod points. Join reddit. Because openness is good.
    15. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Unfortunately, in my experience, deprecated warnings are often ignored by people, *even* if their IDE warns them.

      You'd rather break their code immediately?

      having to be back wards compatible can be a pain as well that slows you down properly fixing/ improving things.

      Ultimately, yes. Eventually, you'd want to throw all your backwards compatibility in some "compat" library.

      But if you do this incrementally, I don't see that you'd have that much to maintain. If you find, down the road, that it's become too expensive to maintain a particular depricated function, drop it then -- but not when you can wrap it in 20 seconds.

      I'd also rather have 10 programmers fix 2 calls each than have to fix all 20 calls myself.

      --
      Don't thank God, thank a doctor!
    16. Re:the point of GWT by SanityInAnarchy · · Score: 1

      They break the API, try to compile and fix all references, and you benefit as a result.

      Actually, they generally don't. Take a look at OSS and ALSA -- they discovered that they were going to have to replace OSS. So they developed ALSA alongside it, and ALSA provides OSS emulation. You can use either, but if you choose to use ALSA, your old OSS programs will keep working.

      You cannot do this practically with Javascript since any Javascript code over 500 lines ends up using eval.

      Bullshit. And I say that, having just written a Javascript program over 500 lines long.

      I didn't use document.write or innerHTML, either.

      Or you might at runtime decide to add a method to a JS class if a certain event happens. Eclipse won't pick up that method until the program actually runs.

      True, at which point you can look at it in a debugger. Which solves eval, too, if you were using eval anyway, which you shouldn't.

      Java, on the flipside, doesn't offer the nice type tricks you can do in Javascript.

      That would be because Javascript essentially has no types.

      You on the other hand, wax poetically about the wonders of Javascript. You are a Javascript fanboi.

      In other words, it's impossible to not be a fanboi unless I have a neutral opinion?

      If someone has a valid reason for Java stinking, I will listen if it's a good point.

      Alright, here you go: It has no closures or anonymous classes. I don't remember it having anonymous functions/methods, either.

      It also has a type system stricter than any I know of. Everything I hated about C++ header files is even worse in Java -- I have to write probably five lines of structure for every one line that actually does something.

      It manages to be much more verbose than it even needed to be for that. Why do I have to declare what exceptions I might throw? That's information that any decent compiler/IDE should be able to figure out for me. Forcing me to type it myself just adds more carpal tunnel and more chances for stupid compile-time errors.

      It caches. The GWT compiler at compile time assembles the JS into different files and decides based on the browser, language, property files, which files to send over.

      In other words, it goes by user-agent? Man, that sucks.

      But apparently you didn't read the rest of my post. Yes, it'll cache -- for one browser, for one version. Update one line of code in a 1k file? Too bad, the users now have to download all 100k of your script. Caching proxy? Has to cache one version of the entire script for each browser, instead of being able to share everything except the small, browser-specific differences.

      Now, practically, most users don't care about this. Most users wouldn't care if it was cacheable at all. But it is a concern.

      Java kool-aid. Yes I see the fanboi in you comes out. No facts, just fanboism and ancient tribalism over a programming language. Java bad. Javascript good.

      Not sure how "ancient" it can be, given how Javascript sucked when it first came out...

      And you're certainly one to talk. Calling names rather than bringing valid facts. Strawmen instead of valid arguments.

      If you have opera, you will download the IE checks.

      All ten lines of them. The horror!

      You rely on me to educate you about GWT vs using it or even reading about it.

      Ditto.

      Your little life lesson would be a lot more helpful if you'd actually tried to read and understand my post. Instead, you instantly branded me a "fanboi" and stopped taking me seriously. What does that say about you?

      --
      Don't thank God, thank a doctor!
    17. Re:the point of GWT by chillenious · · Score: 1

      You'd rather break their code immediately?

      Yep, I prefer to break hard an early. I would typically make the old method final on abstract classes or remove it if it is part of the interface. That together with library versions in case there are multiple projects depending on it, ensures that no-one will miss it.

      I'd also rather have 10 programmers fix 2 calls each than have to fix all 20 calls myself.

      But see, *you* are the one making the change, so you probably know best what the implications are so it's actually not always a bad idea to fix yourself. And if it is in one project, or multiple projects in the same phase, just issues one refactor command in your IDE is enough.

      Now, I'm not dissing deprecation; sometimes that's a good thing and you don't always have the luxury to break hard and fast. But I'm arguing you should want proper support for both. And static typing is helpful in that.

      My 2c :)
    18. Re:the point of GWT by SanityInAnarchy · · Score: 1

      What do I need type info for, when I can just search for the method name?

      --
      Don't thank God, thank a doctor!
    19. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Yep, I prefer to break hard an early. I would typically make the old method final on abstract classes or remove it if it is part of the interface. That together with library versions in case there are multiple projects depending on it, ensures that no-one will miss it.

      It also ensures that your library is going to be a pain to work with on systems that do shared libraries well. Sure, multiple versions can be installed at the same time, but generally, you only want to do that with major revisions -- especially since you need your app to know which version it needs, while at the same time not forcing them to one particular revision.

      In other words: Consider OpenGL. Apps on my system link against /usr/lib/libGL.so.1. On my system, that's a symlink to libGL.so.1.0.9755, which is a specific version of the nVidia driver.

      Obviously, you'd want incremental updates to that driver, maybe even introduce some incompatible new APIs that programs can detect and use, if they're available. But if you really want to break apps, you'd define OpenGL v2, and you might even have /usr/lib/libGL.so.1 is entirely wrappers around /usr/lib/libGL.so.2, which new apps link against.

      But see, *you* are the one making the change, so you probably know best what the implications are so it's actually not always a bad idea to fix yourself.

      Maybe so. But I also don't necessarily know my way around everyone else's code, so I don't necessarily know best what the implications are if I make the change there. Generally, if it's an incompatible change, it is actually going to require more than just changing the one line in which my method is called.

      It also doesn't address the problem of projects that I don't actually control.

      But I'm arguing you should want proper support for both. And static typing is helpful in that.

      Maybe so. I think, though, that if you actually remove the old method (interface, API, etc) and provide a new one, that's sufficient to break it. I think the only difference is whether the break happens at compiletime or runtime, but as we're learning now, unit testing is a must for any sizable project, and unit testing is basically trying to break it at runtime.

      --
      Don't thank God, thank a doctor!
    20. Re:the point of GWT by chillenious · · Score: 1

      Because you can have that same method name/ sig implemented in many classes.

    21. Re:the point of GWT by chillenious · · Score: 1

      It also ensures that your library is going to be a pain to work with on systems that do shared libraries well. Sure, multiple versions can be installed at the same time, but generally, you only want to do that with major revisions -- especially since you need your app to know which version it needs, while at the same time not forcing them to one particular revision.
      Yeah, never do that for minor versions. My experience is though, that you'll always first have a long period of development for a major revision, and a couple of clients with immediate interest in it working on those alphas/ betas. During that period, it's fine to break, and you should take the opportunity to sort your API out. Once you've done that, and churned out your first ga release for a major revision, you shouldn't break clients. So yes, like I said, you should want both.

      Maybe so. But I also don't necessarily know my way around everyone else's code, so I don't necessarily know best what the implications are if I make the change there. Generally, if it's an incompatible change, it is actually going to require more than just changing the one line in which my method is called. It also doesn't address the problem of projects that I don't actually control.
      Note that I say: "so it's actually *not always* a bad idea to fix yourself"

      Maybe so. I think, though, that if you actually remove the old method (interface, API, etc) and provide a new one, that's sufficient to break it. I think the only difference is whether the break happens at compiletime or runtime, but as we're learning now, unit testing is a must for any sizable project, and unit testing is basically trying to break it at runtime.
      Unit testing, the wonderful solution for everything, whether it involves syntax checking or API evolution. Sorry, but I don't buy that.
    22. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Which is probably a bad idea in a dynamically-typed language. I do have an idea for a way around that...

      The only place where that's absolutely a good idea is when all those implementations are supposed to have the same sig/API, so you would want to change all of them at once anyway.

      --
      Don't thank God, thank a doctor!
    23. Re:the point of GWT by SanityInAnarchy · · Score: 1

      Note that I say: "so it's actually *not always* a bad idea to fix yourself"

      I see. Sorry about that.

      But then...

      Unit testing, the wonderful solution for everything, whether it involves syntax checking or API evolution. Sorry, but I don't buy that.

      I didn't say it was a solution to everything. It is, however, a very useful tool, as is test-driven development. And where I can, I would rather specify things as part of a more comprehensive test than as part of the actual code.

      --
      Don't thank God, thank a doctor!
  5. Worse than Wicket? by kisrael · · Score: 3, Interesting

    Yeah?

    I did an evaluation of it. I kind of liked it, but in general don't like "lets make a servlet environment pretend its an applet", so I didn't endorse.

    Now, after months of using Wicket, I wish I had pimped for it more. Seriously. If you're gonna pretend it's an applet, then REALLY do it like GWT does, fake JVM and all. This Wicket stuff.... ugh. keeping the html view and java in synch for anythign complex is SO IRRITATING.

    Seriously, after years of Struts and stuff like Wicket, I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001. There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

    Maybe years of Perl CGI has bent my brain but The HTTP Request/Response paradigm just doesn't seem so awful that it needs to be (leaky) abstracted away.

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    1. Re:Worse than Wicket? by D-Cypell · · Score: 1

      Its funny but I happen to think that Wicket is one of the better web frameworks available in the Java world today. Having used GWT I was really put off by the Javascript as 'bytecode' approach. Different strokes for different folks I guess.

    2. Re:Worse than Wicket? by kisrael · · Score: 3, Insightful

      I just don't see what Wicket - or possibly any web framework - buys you.

      Maybe especially core Wicket, which isn't trying to do much but wrap HTML bits as objects. What really is the benefit of that? Nothing seems simpler and it often seems to be getting in the way-- maybe it's a mental gap problem, but often I end up having to put placeholder HTML in the page, and the set visibility = null. And the Ajax support is so-so.

      I mean, I think the fact that the static Wicket homepages often produce session timeout exceptions is pretty damning that it encourages poor web programming.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    3. Re:Worse than Wicket? by Anonymous Coward · · Score: 0

      I just don't see what Wicket - or possibly any web framework - buys you.

      Because I'm in Soviet Russia you insensitive clod!

    4. Re:Worse than Wicket? by eddy+the+lip · · Score: 4, Insightful

      There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

      I couldn't agree more. I like my code structured, clean and simple, and layering abstraction upon abstraction is not a good way to achieve that. I'm also a big proponent of writing to the language's strengths. JavaScript has some annoying weaknesses (lack of namespaces), but things like it's object prototyping are very powerful, and it seems silly to give that up. For all the browser inconsistencies, HTML + CSS is actually quite a nice layout tool. Getting them all to work together requires some organizational skills, but it pays off in ease of use and a higher level of control.

      These are tools a web developer really should be comfortable with anyway, so while I can see the utility of something like GWT if you're not, to really excel at it, you should be knowledgeable about them.

      --

      This is the voice of World Control. I bring you Peace.

    5. Re:Worse than Wicket? by kisrael · · Score: 2, Interesting

      Yeah.

      Sometimes I worry that I come up with my philosophy about languages to suit my personal gripes and history, and that ultimately that limits me as a developer, but...

      Anytime you borrow someone else's toolkit that adds some kind of organization/abstraction over an existing technology... well, either you're losing bits of the functionality of the lower level, or what you're learning is about as complex as the lower level.

      My strong personal preference is to write your OWN, app-specific organization.

      The counter argument comes from people who are heavily OO in their outlook. (more specifically, I think a gap tends emerge between people who cut their teeth on simple CGI-wrapping things, and got used to using a HashMap mentality for most client/server interaction, and people who cut their teeth on apps and applets, for whom the gap between Java code and what's physically displayed onscreen seems weird and in need of being abstracted away.) Anyway, these folks say that, look, the organization I want is OO, writing this kind of Object->screen element->response mapping ls a repetitive task, so I'm willing to buy into someone else's approach to do that work. That's where something like Wicket comes in.

      My recent semi-revelation for this kind of tool-kit was this: "text" is amazing. It has been the lifeblood of programming for decades, ever since we could get away from punched cards I guess, despite attempts at cutesy visual languages. It's just so powerful, concise, easy to manipulate, easy to automate that manipulation, and in its own way visual (hence the wars over the one true brace style etc) that it will be around for a long long time. But text is, by the way we use it, rather procedural, and while you can do OO in it, that's a new level. But sacrificing the ability to adjust HTML and CSS and Javascript in TEXT on the alter of Objects just seems like too big of a sacrifice to me.

      Of course, taking an anti-OO stance is a heresy (see http://geocities.com/tablizer/oopbad.htm ) and you have to be careful so you don't seem like a crazy nut job who hasn't worked on large scale projects. But my latest take on it is this: "People and Programs are both best defined by what they DO, not what they ARE".

      Another way of looking at it: in Java, when stuff goes wrong, what's your stack trace like? There's always that boilerplate JVM/Server engine at the bottom, but if the core of what's at the top ain't your code, your debugging is going to be a lot harder, because your mistake is in how you set up the other guy's objects to do the work, not you doing the work yourself. (Assuming the other guy's stuff is solid.)

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    6. Re:Worse than Wicket? by poot_rootbeer · · Score: 2, Insightful

      I'm also a big proponent of writing to the language's strengths.

      You can't really write a web application using a (single) language, though; you need to have some degree of expertise in HTML and CSS AND Javascript AND whatever language(s) your server-side code is written in...

      I can see some appeal in toolkits that unify everything into just one language, for the developer's convenience. It's still pretty much impossible that the output of such a toolkit will be anywhere near as elegant or efficient as natively developed code in each area.

    7. Re:Worse than Wicket? by joshv · · Score: 3, Insightful

      Sure, using other people's code makes it harder to debug. And some things are just plain out of your control. Over the course of my career I've spent man-months troubleshooting and configuring 3rd party frameworks. I don't care, because I would have spent man-years writing them myself.

    8. Re:Worse than Wicket? by kisrael · · Score: 1

      The years vs months comparison... I'm not sure I buy it.
      Especially because usually you're just using a subset of the functionality, but to do it right, have to "pay" for (in terms of learning complexity) much more than that.

      That's one reason I love APIs to the heavy lifting, but having a core of the Lowest Common Denominator of control code. For Java, this was Servlet/JSP pairs.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    9. Re:Worse than Wicket? by nuzak · · Score: 2, Interesting

      Wicket's an example of a minimalist concept that refused to grow beyond it in order to satisfy some ideology of "purity". Refusing to support even a moral equivalent of taglibs is an example. Tapestry has always struck me as far more pragmatic, and Tapestry5 looks downright amazing. Seam with Facelets strikes me as an awesome solution, though you're dealing with an insanely complex stack (JSF) under the surface, and wherever JSF is inadequate and Seam doesn't cover for it, you're forced into workarounds that may have you ditching Java for your project altogether.

      I'm an example of the last case -- a java burnout. We never needed scalability (internal apps with maybe 50 total users), so I'm back to cobbling together perl and python and even php now. Ironically, the need to glue these apps together has led to adopting more enterprisey stuff like SOAP and ESB's, but in a very ala-carte way. Useful enterprise apps remain grown, not engineered.

      --
      Done with slashdot, done with nerds, getting a life.
    10. Re:Worse than Wicket? by chillenious · · Score: 2, Informative

      Seriously, after years of Struts and stuff like Wicket, I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001. There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

      Sorry to hear it doesn't work for you. A little OO-obsessed though? Because the framework takes a stance to actually try to provide a real OO programming model where other frameworks simply don't?

      I agree that there is a lot to say for simplicity. Especially if your problem is simple. However, my experience is that model 2 just doesn't cut it. I shudder to think back to the horrible instances I've seen of code duplication you get when you can't properly reuse widgets and the tons of hacks I've seen to get around the statelessness of web applications. And then scripting in templates, making them hard to sync with changed designs/ hire a designer to work on them and simply hard to track where logic is put in the first place. I don't know about you, but I never had much fun refactoring JSP and Velocity templates.

      Wicket focusses on OO as that facilitates reuse and lets you better cope with complexity. Wicket enforces clean templates so that you won't get yourself into maintenance hell. But it may or may not work for you. It does for me and many others, but so many people, so many tastes. In the end it is a trade off that can be annoying in the short term, but should save you trouble in the long run.

      Maybe years of Perl CGI has bent my brain but The HTTP Request/Response paradigm just doesn't seem so awful that it needs to be (leaky) abstracted away.

      If what you are trying to do fits the request/ response paradigm, that's fine. I for one, prefer to reason about screens that have panels, forms, fields, tabs and buttons on them, and I don't want to rewrite half of my pages just because I decide to put a wizard in a tab, or move a pageable list to another page or whatever.

      If you can use Ajax all the way, a simpler approach like using HTML + JS and maybe DWR should work fine, though a library like GWT should help you avoid all those nasty browser issues etc, AND let you write strongly typed (maintainable) code.

    11. Re:Worse than Wicket? by Anonymous Coward · · Score: 1, Interesting

      but often I end up having to put placeholder HTML in the page, and the set visibility = null.
      If you're doing anything reasonably complex, there's really no way around that in Wicket.

      I mean, I think the fact that the static Wicket homepages often produce session timeout exceptions is pretty damning that it encourages poor web programming.
      This pissed me off as well.

      One of the parts of Wicket that annoyed me the most, was that if you needed reasonable URLs it offered very little abstraction over plain old servlets. The default URLs (ie. http://example.com/?wicket-id=?30kdjf309fj20fj30f8 4fj4) really aren't acceptable on public facing websites.... Many would argue that they aren't even acceptable on internal websites used within a single organization. Especially, when you link to that URL and it proceeds to generate session timeouts. To fix the ugly URLs, you have to use BookmarkablePageLink for practically every link in your application, parse the URL arguments for every associated page, and use a sufficient URL coding strategy. Dealing with the session timeouts requires even more boilerplate that apparently most Wicket developers don't even bother with. The wicket examples that are provided by the core Wicket team still suffer from ridiculous URLs and regular session timeouts. I won't even go into how these problems get worse once you start using complicated components and Ajax....

      How all this nonsense makes things easier is anyones guess. It's easier and cleaner to write a small abstraction over the servlet API and disregard the framework altogether.

      Although I don't really like Wicket, or any Java web framework for that matter, I do think well thought out web frameworks can increase productivity and result in cleaner code when used properly. I think Django, Rails and Seaside are reasonably good examples of this.
    12. Re:Worse than Wicket? by chillenious · · Score: 3, Informative

      I just don't see what Wicket - or possibly any web framework - buys you. Maybe especially core Wicket, which isn't trying to do much but wrap HTML bits as objects. What really is the benefit of that?
      You're obviously missing the point indeed. What it aims to do besides providing abstractions is facilitate a stateless programming model that is safe by default and doesn't leak implementation details of widgets all over the place.

      but often I end up having to put placeholder HTML in the page, and the set visibility = null.
      use <wicket:enclosure> an you don't have to use extra placeholders.

      And the Ajax support is so-so.
      What's wrong with it? It's entirely optional.

      I mean, I think the fact that the static Wicket homepages often produce session timeout exceptions is pretty damning that it encourages poor web programming.
      If pages are not session-relative, design them to be bookmarkable. All you need to do is put a default constructor or a page parameters constructor in them. With Wicket, you'll have to do a bit of planning for bookmark-ability. But why is that bad? It is secure by default. In contrast with most application frameworks and the REST approach that let you leak internal things like PK's etc by default, so that you'll have to secure your site as a separate effort. Creating a site in the model 2 two way with Wicket, completely stateless, isn't very hard either. Just make pages for every function (like you'd do with actions for model 2 frameworks) and use page parameters to pass your 'state' around.
    13. Re:Worse than Wicket? by eddy+the+lip · · Score: 1

      Here's a funny thing - I go through the same questions, wondering if I'm holding on to old biases that have gone past their best-before date. Every couple years I'll take a look around to see if I'm missing something, and invariably come to the conclusion that things Aren't Quite There Yet. Then I'll go refactor some of my own light-weight libraries and move on. Which makes me wonder how subject I am to NIH syndrome. But I get things done.

      The punch line is that I did cut my teeth on CGI (perl 4) and a hash map for dispatching requests, and now I'm almost completely OO. I don't think it's the only way to do things, but I'm more comfortable with it. I certainly like the freedom to drop into procedural or functional when I think it fits better, but my bias is definitely for objects. I try not to be a zealot about it. That just doesn't have any place in a field with pretty well defined parameters. I like to leave that for the theologians.

      Of course, after committing many of my own sins of over (or just poor) engineering, I have a very low tolerance for it in third party stuff. I was recently working in something that had six levels of inheritance put together by someone who obviously didn't understand composition. I didn't sleep well a few nights.

      Things like HTML generating classes just for the sake of staying in a comfortable paradigm boggle my mind. Like you said, ain't nuthin' wrong with text. I'd rather learn something new than shoehorn it into The One True Way (whichever way that happens to be.) I find there's a lot more flexibility and power in letting each technology be itself, and adapting to it, instead.

      I don't imagine we've seen the last of this kind of thing by a long shot. I'm convinced, though, that sticking to fundamentals is what's helped me keep up on new technologies, and keep myself relevant. If everyone else is on a bandwagon, it just means it's quieter where I am.

      (Liked the site linked in your sig, by the way. Good stuff.)

      --

      This is the voice of World Control. I bring you Peace.

    14. Re:Worse than Wicket? by pebs · · Score: 1

      but if the core of what's at the top ain't your code, your debugging is going to be a lot harder, because your mistake is in how you set up the other guy's objects to do the work, not you doing the work yourself. (Assuming the other guy's stuff is solid.)

      That's why I like to have the source code for my 3rd party libraries that I use. That way I can learn the other guy's code. I can link the code in with my IDE so that when a problem occurs I can trace through the code in those 3rd party libs.

      With Java, I don't use any 3rd party libraries that aren't open source. And some of the key libraries I use (though not all), I am familiar with the source code and how it works. If I am not familiar, I can always become familiar with it when a problem occurs. It's generally good to pick 3rd party projects based on how clean their source code is (among other things), so when you do have to go dig in, its not as difficult.

      I think this situation can give you an advantage over writing your own.

      --
      #!/
    15. Re:Worse than Wicket? by eddy+the+lip · · Score: 1

      Oh, yeah, that's pretty much what I was trying to get at (unless I misunderstand.) HTML and CSS and javascript and whatever server-side language you're using are all different beasts, and I personally prefer to meet each on their own terms. It might take a bigger learning investment, but the payoff is understanding everything that's going on, and being able to manipulate it at a fine grained level. And you can take advantage of the strengths inherent in each, while occasionally offsetting their weaknesses with one of the other tools in your kit.

      I can see the appeal of staying in your own paradigm, and maybe there's even places where it's the right way to go. But I'm pretty sure that knowing each individually gives me better results faster. Might not be true for all.

      --

      This is the voice of World Control. I bring you Peace.

    16. Re:Worse than Wicket? by CryBaby · · Score: 1

      I felt the same way about GWT -- it's just too much of a black box for my taste. Having said that, it's probably a good idea to reevaluate it now that I use a lot more Ajax and am far more comfortable with JavaScript than I was a year or so ago.

      Regarding Wicket, however, I couldn't disagree more. I think Wicket offers by far the best balance of productivity and maintainability compared to any action or component-based Java web framework out there. There are, however, a couple of caveats.

      1) Wicket's sweet spot is complex applications (esp. with a lot of Ajax) that *happen* to be served over http. iow, it's probably not a great fit for simple, high-volume public sites (although Wicket devs may disagree by pointing out some of the new features in 1.3 that offer excellent support for stateless pages).

      2) You won't like Wicket if any time you see a decorator or composite pattern you either a) don't recognize it or b) refer to it as an "over-engineered" solution. Of course, if that's the case, you probably shouldn't be using Java in the first place.

      In general, if you enjoy programming in Java and you like the idea of writing web UI code in more or less the same way you write domain code, you'll probably prefer Wicket to just about any other framework. To back that statement up a bit, I'll mention that *all* of the programmers on my team now write Wicket UI code as well as middle tier code even though some of them have never written a web app before in their life. That was not the case when we used Tapestry because, as nice as that framework is, you still have to think in terms of the request/response cycle to do anything complex and you have to learn a lot about it by rote, as opposed to Wicket where you can learn most of the framework simply by exploring it from within your IDE.

      Seriously. If you're gonna pretend it's an applet, then REALLY do it like GWT does, fake JVM and all. This Wicket stuff.... ugh. keeping the html view and java in synch for anythign complex is SO IRRITATING.

      Sure, the "purity" of GWT's approach is undeniably appealing, but I'm reluctant to give up the simplicity of HTML templates, regular Java code that runs on a real JVM, and regular, non-generated JavaScript. As far as being irritated by having to keep your ultra-simple Wicket HTML templates in sync with your straightforward, plain Java code, I'll just say that it's much better than having to keep templates with embedded logic in sync with an abstract, runtime enhanced class along with a bunch of XML configuration. So, coming from Tapestry 4, code/template synchronization in Wicket has been a complete non-issue for me.

      Seriously, after years of Struts and stuff like Wicket, I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001. There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

      I'm not sure if you're advocating the abandonment of all web frameworks or if you just don't see the advantage of a component-based framework as opposed to an action-based framework. The problem with a "bare-bones, no framework" approach is that it usually translates into a custom framework for each application and/or a big mess of copy-and-paste spaghetti code that can only be deciphered by the original author.

      The advantage of component-based frameworks is that components naturally correspond to objects whereas action-based frameworks lend themselves to a more procedural approach. I also think that web pages themselves make more sense when viewed as a collection of potentially reusable components (even when I wrote PHP apps, I wrote them in a component-oriented style), but I guess that's a matter of opinion.

      Regarding that last statement about "writing HTML in HTML and writing Javascript in Javascript", I would just add "writing Java in Java" and point out

    17. Re:Worse than Wicket? by joshv · · Score: 1

      Perhaps you write simple apps, but I would never be able to provide the level of functionality I provide to my clients without extensive use of third party frameworks. I just don't have the resources to code these sorts of things from scratch.

      A relatively simple example - I've written several apps that produce PDF and Excel output - iText and Apache POI have been invaluable. Sure, they've been a pain at times, but they have been more than worth the trouble. They've saved me time and allowed me to produce a professional, polished product that I would not have been able to deliver otherwise. And the price was right.

    18. Re:Worse than Wicket? by CryBaby · · Score: 1

      Maybe especially core Wicket, which isn't trying to do much but wrap HTML bits as objects. What really is the benefit of that? Nothing seems simpler and it often seems to be getting in the way-- maybe it's a mental gap problem, but often I end up having to put placeholder HTML in the page, and the set visibility = null. And the Ajax support is so-so.
      Sounds like your problems with Wicket are due to your total lack of knowledge about the framework. Hint: there's nothing called "visibility" in Wicket. There are isVisible() and setVisible() methods on the Component class, but they take and return a boolean primitive so setting "visible" to null would result in a compile error. And no, I don't believe you just made a typo. Nobody who uses the framework would forget such a common method. Maybe you used Wicket for a day or two in the distant past, but you're obviously in no position to comment on the relative merits and deficiencies of the framework. In short, you appear to be a troll.
    19. Re:Worse than Wicket? by kisrael · · Score: 1

      Ah, well it might be a thing of terminology... I have no problems with going to outside APIs and libraries for specific bits of functionality, I certainly wouldn't to write PDF or Excel generators at a low level... it's the difference between APIs/libraries vs Toolkits/Frameworks. (We're more talking the most efficient and maintable way to do bread and butter stuff like "make a web application")

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    20. Re:Worse than Wicket? by kisrael · · Score: 1

      Yeah, and I might be biased by my years of "Jack of All Trades" homebrew websitery, but yes, I think a web developer SHOULD know CSS, Javascript, and HTML, because most apps are demanding enough that they'll be wading through that stuff anyway.

      I also find it easier to import 3rd party javasvript/DHTML widgets when I don't have to sweat wrapping it in Java objects.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    21. Re:Worse than Wicket? by CryBaby · · Score: 1

      First, I need to apologize for calling you a "troll" in an earlier post. It sounds like you just have a very different view of things, and that of course doesn't give me the right to insult you.

      I'll just say that your criticisms of Wicket are so entirely opposite of my experience with the framework that it's frustrating and somewhat confusing to read your posts.

      So you do seem to be advocating the "write your own framework" approach, which I've already addressed to a certain degree. I'll add/reiterate that it amounts to reinventing the wheel for every web application you write, runs completely counter to the concepts of code reuse and modularity and, in short, is almost always the wrong choice for a large-scale application when there are so many good Java frameworks to choose from.

      You talk about "sacrificing the ability to adjust HTML and CSS and Javascript in TEXT on the alter of Objects" but, again, I find myself agreeing with your point but failing to see how it applies to Wicket. Wicket doesn't interfere with your use of plain HTML and CSS. This is one of its advantages.

      You mentioned a "mental gap" in an earlier post and I honestly think that's why you see Wicket as getting in the way of, rather than augmenting, improving and accelerating your web programming. Some people look at a web page and see a big linear string of text. I see a concentric arrangement of components (whether I'm using PHP, Java or whatever -- it's always been that way). Some people find that OO concepts fit most of their programming problems really well while others see it as overkill.

      Wicket is simply not intended for programmers who don't "get" or like component-oriented, heavily OO frameworks. It's at the opposite end of the spectrum and the documentation, etc. makes this pretty clear. So I can't help but wonder why you ever used it in the first place and what exactly you expected to get out of it when it clearly doesn't fit your preferred, procedural way of working.

    22. Re:Worse than Wicket? by ajm · · Score: 1

      So, you never use a compiler of any sort do you because you can write more elegant code more efficiently using assembler in vi? The great innovations are GWT is compiling to javascript and hosted mode debugging, not some widget set or other. After writing an app using dojo rewriting it using GWT was a massive breath of fresh air. Productivity is much higher, not just initial development but later debugging and maintenance. Programming is about working at the right level of abstraction with the right set of tools. At the moment IDEs for Java offer far better support for writing and maintaining applications than any other toolset. Why make life harder for yourself?

    23. Re:Worse than Wicket? by phaggood · · Score: 1

      > I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001.

      Sounds like you want to take a look at IBM's Hamlets - a nice example of the "simplest solution possible".

    24. Re:Worse than Wicket? by kisrael · · Score: 1

      Screw you, it was a typo.. or rather, a brain-o.

      Read my post (I think as kirkjerk) in the apache mailing list. I know setVisibility takes a boolean. I've been using Wicket solidly for 6 weeks.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    25. Re:Worse than Wicket? by kisrael · · Score: 1

      Apology accepted. I don't troll per se, but sometimes do try to provoke intelligent responses in a slightly ugly way.

      And trust me, I'm just as frustrated and confused by people who adore Wicket and say it has a great power/conceptual weight ratio! Especially because I'm concerned it points me to being a curmudgeon before my time, unwilling or unable to learn new things.

      The last time I "rolled my own framework", which was just some tools to make "Model Two Plus" (servlets and JSP pairs; esentially MVC w/ lots of Cs) I came up with two things: one was the "FormFieldHolderBean" that made it very easy to populate HTML forms w/o conditional logic in the JSP, much like the ActionForms in Struts that I ran into later. The other concept was, for those multiple Servlets, there should be as LITTLE cut and paste, non-business logic as possible... we really got it down to just 4 or 5 lines per Servlet, by farming repetitive things out to a single superclass or to APIs.

      The thing with this approach is, it was VERY easy to know where to look when things went wrong. It was conceptually super light weight, and in general inspecting the URL would bring you to the appropriate servlet or JSP. Compared to the stack traces I've had to sort through in intervening years, I view those days as somewhat of a golden age...

      We're finding that while Wicket does let you customize CSS and HTML (but not always easily, yesterday my coworker who's pretty CSS adept couldn't figure out how to stop one of the close to builtin tree controls from having a border) there are still a lot of problems where we have to figure out "ok, the javascript is fairly easy, but what's the Wicket way to do this"? One example was some sortable tagbles w/ selectable rows, preserving the selection across sorts and groupings. We got it, but it seemed less elegant than we would have liked.

      I probably do have a text-centric (thanks, Perl) outlook, but even to the extent I see "components", I see them as "DHTML components", and the mapping to Java objects seems forced.

      Another problem with all this... Wicket is in desperate need of a few more teaching books and a really good recipe/cookbook.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    26. Re:Worse than Wicket? by kisrael · · Score: 1

      Well, are you arguing for Wicket, or for GWT?
      At this point I'm still willing to give GWT the benefit of the doubt.

      I hear your point that you can take my argument to an illogical extreme (lets just toggle panel switches!) but that doesn't mean the opposite is true. I wouldn't want to write an applet by having to control individual pixels either, but the fact is web apps have a pretty good toolset, DHTML, Form Elements, CSS, and in my judgement, unless you embrace a full on JVM-ish approach like GWT, then the easiest way of fiddling with those elements is by manipulating text, and writing your own wrappers as needed.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    27. Re:Worse than Wicket? by kisrael · · Score: 1

      The :enclosure thing is interesting... I don't know a lot about it, which kind of points to one possible source of problems, Wicket doesn't have a lot of non-example and non-javadoc documentation... just that one book and some very basic tutorials.

      I haven't seen leaky PKs be too much of an issue. A lot of keys are just local identifiers, or your API should be doing requisite security checks.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    28. Re:Worse than Wicket? by kisrael · · Score: 1

      I guess in Wicket I get most bugged by the "parallel hierarchies" of things I've add()ed in the java, and then represented in the HTML. At least that gets me the most stack traces...

      Again, it's the background thing. HTTPRequest/Response seems like the most natural thing in the world to me, in part from years of CGI. But hell, from years of using the Web! Click, or submit, and get a page back. Or, nowadays, click, and some part of the page goes and updates, ala Ajax. And the Session model, a simple Map to store things, was the easiesst thing to keep a mental model of (of course, clustering then became an issue, but that's not too surprising, anything cross JVM is a bit dicey)

      I guess I don't feel I was easily able to learn most of the framework by poking around my IDE.

      I guess I described my homegorwn super-lightweight framework elsewhere.

      For reusable page components, I guess the "super lightweight" answer is either JSP includes (which admittedly tends to be dependent on page scope variables), use of Java objects that spit out HTML (which doesn't have to be as big a sin as people pretend), or, a bit more recently, use of custom tags.

      So far in my (jaundiced) observation its been about 50/50 like Wicket or dislike. And I do think it's what kind of applications you wrote before, traditional web vs applets or other things where the object doesn't have to go through so much change to get to a visual representation;.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    29. Re:Worse than Wicket? by chillenious · · Score: 2, Insightful

      just that one book and some very basic tutorials.
      And now Wicket In Action is available (partly) via early access. But agreed documentation could be better, which holds true for most open source projects that depend on unpaid volunteers.

      I haven't seen leaky PKs be too much of an issue. A lot of keys are just local identifiers, or your API should be doing requisite security checks.
      But it is something you'll always have to be aware about. The application I'm working for for instance, has a very fine grained authorization model. Now, I never have to worry about users accessing the wrong data just by guessing URLs etc; all that information is server-side only. And I know from experience that that would have been quite a different story when using e.g. a model 2 framework.
    30. Re:Worse than Wicket? by nullchar · · Score: 1

      there are so many good Java frameworks to choose from

      This could be viewed as a rhetorical question, but seriously, why ARE there so many Java frameworks? GWT is certainly not the last Java web framework we shall ever see.

      To me, the Java language is beautiful, and has a rich API with great third party libraries. Yet doing web stuff is a pain to setup (application server), configure (XML), code (with framework of the day), and maintain (people's real-world implementation using 'frameworks' can be quite terrible -- yes, I'm looking at you, Spring).

    31. Re:Worse than Wicket? by crucini · · Score: 1

      My recent semi-revelation... But text is, by the way we use it, rather procedural, and while you can do OO in it, that's a new level. But sacrificing the ability to adjust HTML and CSS and Javascript in TEXT on the alter of Objects just seems like too big of a sacrifice to me.

      Well said! Same applies to SQL, and the clumsiness of object-relational mapping. SQL selects are awesome - why ruin them? Same with generating a printed document in Postscript vs. using an API; Postscript is text, and is easily manipulated, transformed, concatenated and tested.
    32. Re:Worse than Wicket? by eennaarbrak · · Score: 1

      People and Programs are both best defined by what they DO, not what they ARE Ironically, that is exactly what OO is all about - hide the data and expose the behaviour.
    33. Re:Worse than Wicket? by chillenious · · Score: 1

      Wicket's an example of a minimalist concept that refused to grow beyond it in order to satisfy some ideology of "purity".
      That sounds pretty negative. Another way of saying is that Wicket stays true to it's philosophy and puts consistency before feature explosion. I don't think giving in to every whim is helpful in developing a robust framework at all.

      Refusing to support even a moral equivalent of taglibs is an example.
      Not entirely true. See the wicket:message and wicket:link tags for instance. Developing custom ones is fairly easy.
    34. Re:Worse than Wicket? by Anonymous Coward · · Score: 0

      > coworker who's pretty CSS adept couldn't figure out how to stop one of the close to builtin tree controls from having a border)

      Huh? Stop builtin three controls from having a border? It's a simple as adding a CSS class to your stylesheet. To any person with basic web development knowledge it should take about 5 minutes to figure out.

    35. Re:Worse than Wicket? by joss · · Score: 1

      > is almost always the wrong choice for a large-scale application

      No, its wrong for a medium-scale application. For large
      applications, it can make perfect sense for people to write
      their own frameworks.

      --
      http://rareformnewmedia.com/
    36. Re:Worse than Wicket? by maraist · · Score: 1

      Structured, tiered code is excellent. But here are my problems with the web stack:
      HTML is NOT well structured. It is not XML.. It is not trivially validateable (yes there are tools that specialize in this - even many editors). It's hard to write in WYSIWYG with sprinkled code. You're at best approximating what the final output will be.

      Tag-libs (be it velocity, php, JSP 2.0, scriplets) make it difficult for editors to function properly.. You have two or 3 natural code syles being squashed together - a huge impedence mismatch. You really need a seamless coding environment for the front end.. And it simply doesn't exist to date.

      There are excellent WYSIWYG HTML renderers which are completely useless once you've added your first line of code.. They are also useless if you want to modularlize your HTML with includes. Templating frameworks in those WYSIWYG editors generally requires all HTML to flatten out (and thus be duplicated, redundant and a pain to maintain after it leaves the perview of that editor).

      JSF + ajax4j is kind of neat in that there is almost no need for 'code' in the HTML.. Just symbolicly added events which cause the update of sub-sections of the page. But JSF in general is HEAVILY taglib oriented which amplifies the problem of good HTML designers.

      Next is the fact that javascript is a HORRIBLE lanugage, with respect to software engineering.. If you just want a toy popup, or reveal / position relocate.. It's not too bad.. But usually you want generalized code.. And name-space collision, lack-of error-vetting, HORRIBLE load use-cases. HORRIBLE code-relocation (code doesn't do the same thing if loaded in different environments), lack of even consistency between browers, lack of versioning of code, lack of repositories, lack of efficiently compileable nature (e.g. does NOT scale to large volumes of code).

      This all being said, what I like about GWT is that simple things are simple and well defined again.. I construct a Dialog object, associate input-fields options, a button. I associate actionable code with the button, form, etc. The code is MUCH smaller.. It's modular, reusable, extensible.. So if I want 10 pages that are 90% similar, I create a base class with that common code, then extend it for those 10% differences.. Less total lines to maintain than in HTML. I don't have to deal with the quirks Javascript (just temporary 'bugs in GWT). We get name-space safety because the JS functions are compiled against java-packages. You get your company wide suite of libraries (all name-space safe).. You can have central open-source repositories of GWT libraries (again due to name-space safety - every JS open-source library wanted to use functions like 'calendar', 'drawTree' - Thus completely poorly planned out software engineering projects). You get compile-time validation of code (so far as the GWT compiler can anticipate problems). Your web-site becomes trivial to 'skin', 'theme', etc, because just like a 1980s UI, we're talking about a common UI engine controlled by state variables that you define.

      The down-side, you have to enjoy Java.. You have to enjoy AWT / Swing style programming. You LOSE all usefullness of any graphics designer except for images and style-sheet construction. You must render a non-trivial volume of javascript even for the most trivial web sites. Now a 200+ page web page won't render as fast, because you're not pull static HTML, but instead iterating over a javascript loop to inject those HTML elements. Currently GWT has a directory structure and deployment cycle which is somewhat frustrating for my work pattern (which happens to be maven2).

      But I haven't heard any challenges to GWT in it's role of software engineering. I find it has fewer bugs, and can construct far more versitile applications..

      As for MVC, it's also the perfect V. Your stateful system is nothing but a view.. You have to make stateless calls back into the C to do anything. SEAM 2.0 has an adaptor which links that call back into the managed-bean

      --
      -Michael
    37. Re:Worse than Wicket? by kisrael · · Score: 1

      AND let you write strongly typed (maintainable) code.


      See, I think statements like that show a divide that's tough to cross, a set of assumptions about the value of OO that are deep enough that if someone's not convinced, it takes a lot of discussion... and use of "toy" examples always seems suspect, so that if the doubter doesn't experience some moment of revelation while doing actual work, they just won't believe you. More scariliy, their own preconceived notions might lead them to be Unable to come round to the other point of view.

      So: I think it's extremely debatable that strongly typed == maintainable.

      I've done a lot of work in Java, but also a lot in Perl and other "duck typed" languages, And very, very rarely do I get burned by "oh damn, the computer used this variable in a way I didn't expect, because of the typing.

      Now, where Perl DOES fail is in the syntax for grouping something into objects. And sometimes I really miss that, and there are some personal projects I'd like to do in Perl, but realize the thing would get too messy without a stronger (and more semantically sweet) OO paradigm.
      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    38. Re:Worse than Wicket? by chillenious · · Score: 1

      So: I think it's extremely debatable that strongly typed == maintainable.

      It is. And as you may have guessed by now, I'm in the camp that says strong typing, or rather, static typing, is a good thing.

      I regularly do stuff with Ruby for instance. As much as I like the language, it annoys the hell out of me that I spend much of my time fixing stupid syntax errors and googling for object/ method descriptions etc. Same thing when working with Javascript. With static typing and a good IDE on the other hand, navigating through/ discovering APIs is really a breeze, and things like code completion can improve productivity quite a bit. And while refactoring is often a very tedious with other languages, in Java (and again, with a good IDE) it's a breeze.

      Of course there is a fine line between how much extra verbosity and rigidity gets in the way of productivity, or how much long term gains cost you in the short term. I'm not as zealous an OO/ static typing fanatic as I may come across here, but I do believe the best APIs are build consistently to a clear vision, and it is part of Wicket's vision to support statically typed (Java) OO programming to the maximum extend. That doesn't mean we think all other ways are wrong, it's just the path we choose.

    39. Re:Worse than Wicket? by kisrael · · Score: 1

      Fair enough. And of course my view from Perl is "I feel lucky if I get an editor w/ syntax highlighting", whereas with Java I'm usually in Eclipse, which does an ok job with that kind of thing. So I can see the potential for your point.

      Getting back to some of the original debate... I guess it's always a tradeoff. I think some good engineers tend to (IMO) overestimate the cost of, say, having to duplicate a change across multiple items, and underestimate the "conceptual weight" of working with a system rich enough that it's almost "meta-" about the change you're trying to make, so that it can, in effect, make the change for you across those pages.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    40. Re:Worse than Wicket? by CryBaby · · Score: 1

      I guess in Wicket I get most bugged by the "parallel hierarchies" of things I've add()ed in the java, and then represented in the HTML. At least that gets me the most stack traces...

      Well, that's a direct result of the hierarchy being defined in code rather than the template. Think of it as one step short of using layout managers and foregoing HTML templates entirely (a la GWT). Plus, out-of-sync hierarchies result in a fairly friendly message telling you exactly which side is out of sync and where. It's not accurate to just call this a "stack-trace" as if the framework provides no help in locating and solving the problem. Again, my experience has been different in that I don't even think about "parallel hierarchies" any more. It just seems natural that the template would need to match the logical hierarchy defined in code.

      For reusable page components, I guess the "super lightweight" answer is either JSP includes (which admittedly tends to be dependent on page scope variables), use of Java objects that spit out HTML (which doesn't have to be as big a sin as people pretend), or, a bit more recently, use of custom tags.

      Includes are basically a really primitive version of components. As you mention, they tend to depend on external scope rather than being truly independent, reusable objects. They work, but they're far less elegant and, imo, far less maintainable and much more error-prone than true components.

      "Java objects that spit out HTML" sounds like a component to me. I mean, Wicket components are Java objects that spit out HTML, right? Again, you're free to write them yourself if you want but it's tough to justify when there are already a number of frameworks that have done most of the work for you.

      So far in my (jaundiced) observation its been about 50/50 like Wicket or dislike.

      hmmm... if anywhere close to half of the people that use Wicket dislike it, it seems like at least a few of them would have related the experience on a blog or something. And certainly such a horrible ratio of like/dislike would be evident on the user list in the form of a lot of angry, dissatisfied people. Instead, just about everyone who's used it raves about it and the (very busy) Wicket user list has more than the usual amount of praise for the framework. If I had to guess, I would say it's more like 95/5 like to dislike. In fact, one of the strongest arguments for Wicket is the nearly unanimous enthusiasm for the framework by those who use it.

    41. Re:Worse than Wicket? by CryBaby · · Score: 1

      Good point, I meant "large" as opposed to "small". Medium-scale is a more correct term. However, the vast majority of Java web applications are "medium-scale" so I would stick to my point by saying "writing your own framework is almost always the wrong choice for a Java web application."

    42. Re:Worse than Wicket? by CryBaby · · Score: 1

      And trust me, I'm just as frustrated and confused by people who adore Wicket and say it has a great power/conceptual weight ratio!

      Fair enough, but that describes the vast majority of Wicket users. It's not like people who "adore" Wicket are some kind of anomaly. I would say that it has a "good" power/conceptual weight ratio. It's more compelling advantage, imo, is the excellent maintainability achieved by defining all logic, including presentation logic, in Java code and keeping the HTML and JavaScript complexity to a minimum (or at least encapsulating it in reusable Java classes).

      there are still a lot of problems where we have to figure out "ok, the javascript is fairly easy, but what's the Wicket way to do this"?

      Not that Wicket doesn't have it's own concepts that one must learn, but when one of the devs on my team asks that kind of question, I usually say "how would you do if you were just writing Java code and not using a web framework?" and that usually leads to the right answer.

      One example was some sortable tagbles w/ selectable rows, preserving the selection across sorts and groupings. We got it, but it seemed less elegant than we would have liked.

      At the risk of over-simplifying the problem you experienced, that sounds like the kind of situation we run into from time to time where someone is making a problem more complicated by looking for a "Wicket way" to do something instead of just treating it like any other Java code.
      Assuming you were using the Check and CheckGroup components, the selected rows are stored in whatever collection you supplied as the CheckGroup's model. So, to preserve the selection you simply have to keep a reference to that collection (via an instance variable in your page or component), just like any state you would keep for any normal Java object. I think if you had posted this question on the user list you would have received a quick and concise answer and probably even a code example.

      I probably do have a text-centric (thanks, Perl) outlook, but even to the extent I see "components", I see them as "DHTML components", and the mapping to Java objects seems forced.

      You have to keep in mind that Wicket is, in large part, conceptually based on Swing. It tries to treat the web like a Java GUI rather than simply using Java to spit out HTML in the manner of PHP or Perl. Again, the Wicket documentation, code examples and API make that pretty clear so if you prefer a more text-centric, procedural approach then Wicket is probably not the best framework for you. I happen to think that most web frameworks (Java and non-Java alike) are backwards compared to Wicket's OO-centric, more GUI-like approach. Instead of complaining about them, I simply don't use them. If I was forced to use one, I would either "get over" my prejudice and try to master the framework or find another job.

      Another problem with all this... Wicket is in desperate need of a few more teaching books and a really good recipe/cookbook.

      Heh, well I can't disagree there. You're hardly the only person with a background in Perl, PHP or some other "close to the request cycle" web background who finds themselves wanting or having to learn Wicket. And it is definitely a big conceptual leap from a typical, non-OO web framework. Hopefully the forthcoming "Wicket in Action" book (written by Wicket devs) will address that issue.
      When this complaint comes up on the mailing list, users are often pointed to the extensive code examples as a primary learning resource. Because almost everything you do in Wicket happens in plain Java code, the examples do teach beginners most of what they need to know, but advanced concepts could certainly use a more thorough treatment than what's found on the wiki.

      Assuming that you can't switch web frameworks right now, you might change your mind about Wicket if

    43. Re:Worse than Wicket? by jonnny3 · · Score: 1

      Even if I do say so myself, I feel Wicket is the positively the best framework for implementing complex HTML/AJAX applications on any platform, in any language.

  6. I Still don't know what GWT is by chad_r · · Score: 4, Informative
    The review had everything except a brief summary of what GWT actually is. I had never heard of it until now. From http://code.google.com/webtoolkit/overview.html:

    What is Google Web Toolkit?

    Google Web Toolkit (GWT) is an open source Java development framework that lets you escape the matrix of technologies that make writing AJAX applications so difficult and error prone. With GWT, you can develop and debug AJAX applications in the Java language using the Java development tools of your choice. When you deploy your application to production, the GWT compiler translates your Java application to browser-compliant JavaScript and HTML.

    Here's the GWT development cycle:

    1. Use your favorite Java IDE to write and debug an application in the Java language, using as many (or as few) GWT libraries as you find useful.
    2. Use GWT's Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server.
    3. Confirm that your application works in each browser that you want to support, which usually takes no additional work.
    1. Re:I Still don't know what GWT is by jilles · · Score: 1

      GWT is a development kit for developing AJAX applications, such as for example GMail. The concept consists of doing all the programming in Java (similar to how you would develop a Java desktop application) and cross compiling the client components to javascript + html. The advantage of this is that you don't have to think about html, javascript, browser-server communication and many other difficult browser issues that most other web developers waste most of their time on (instead of implementing functionality). GWT makes things like interacting with the browser history, back button and other difficult to do stuff dead easy. Basically the toolkit encapsulates all the javascript voodoo that you normally need to do to do this properly & cross browser. Just define all logic as Java code GWT generates the rest. Of course you can also go for a partial approach where you do part of the application using ordinary javascript and html and only do parts of the app in GWT. Basically this allows you to use as much or as little of GWT as you need.

      The IDE part is integrated into eclipse and offers all the advanced development features that Java programmers are used to like incremental compilation, refactoring, auto-completion etc. To the developer, GWT looks like just another Java library that builds on all the idioms and patterns they know already. Of course you can debug your application as well either before or after compiling to javascript (i.e. set breakpoint in java code, launch browser to test and trigger the breakpoint, then inspect java code). Basically GWT fixes a lot of stuff that makes AJAX development suck so much: you work in a advanced IDE instead of a crappy text editor that doesn't have a clue about the semantics of what you type; you debug in one of the best debuggers around; browser compatibility issues are taken care off during compilation; you'll know if there's a type error because Java is statically typed; you can do unit testing; etc. In short, GWT is about bringing lots of good development practices from server side Java to browser client side. There's not that many tools around that do this to the extent that GWT does.

      GWT is part of a growing set of web development related technology coming from Google. Other nice stuff is the Guice dependency injection serverside component framework for Java and the Gears offline web application component. Presumably, Google eats their own dogfood so the stuff is demonstrably scalable and quite capable as well. Also interesting to learn for the Java hating crowd on slashdot is that the world's largest internet company is a Java shop.

      --

      Jilles
    2. Re:I Still don't know what GWT is by tyrione · · Score: 1

      Cocoon 2.2 Frameworks does this and a helluva lot more.

    3. Re:I Still don't know what GWT is by drfreak · · Score: 1

      4. Profit!

  7. Beyond hope by k-zed · · Score: 5, Insightful

    The sentence "Server-side computer languages, such as Java, possess numerous advantages over their client-side counterparts - including more robust integrated development environments (IDEs)." is possibly the most retarded thing I have ever seen on Slashdot. Ever.

    Come on, doesn't anybody read these?

    --
    we discovered a new way to think.
    1. Re:Beyond hope by drdanny_orig · · Score: 1

      I'm glad to see someone else thinks so too. I was beginning to think it was just me, or that I'd misread it.

      --
      .nosig
    2. Re:Beyond hope by Bluesman · · Score: 4, Funny

      Yeah, it's one of the dumbest things on the front page *today*, but ever? Let's not get carried away.

      --
      If moderation could change anything, it would be illegal.
    3. Re:Beyond hope by ceoyoyo · · Score: 1

      I thought the same thing. Then I realized that the writer probably doesn't realize there's any other type of programming in the world other than web apps. Then it's just oversimplified and erroneous as opposed to retarded.

    4. Re:Beyond hope by owlstead · · Score: 1

      I don't even think that the author does not know this. I think he was deliberately limiting his view to web applications. And to state that there is less support for languages supported in the browser (JavaScript, some Visual Basic) against those supported by the server (all of 'm really). Well, that's true, isn't it? So that would make the statement true, at least in the - supposedly - domain he was targeting. The initial reply of the grandparent was a bit over the top, in my opinion.

  8. GWT *and* Java by owlstead · · Score: 4, Informative

    I would like to point out that the GWT can also be used from a Java server application. I'm using a package from Instantiations, WindowBuilder Pro, that can generate Swing (default Java GUI), SWT (IBM/Eclipse GUI) as well as the Google Window Toolkit. It's an application/plugin for creating graphical interfaces, so you would probably not get too exposed to the GWT itself. I haven't yet tried it out, but it might be a good idea to start of with a GUI builder and only delve deeper when needed. Of course, understanding what happens is great when you need to debug something, or if you are not happy with the functionality. But I would not start off by writing web-pages when trying out this relatively new technology.

    Before somebody grills me, the version of WindowBuilder Pro that I am using is a bit unstable and crashes Eclipse now and then. Lots of memory is also recommended (then again, if you are a developer, you need lots of memory anyway).

    1. Re:GWT *and* Java by owlstead · · Score: 2, Informative

      I *knew* I was too tired to write this reply. Google Web Toolkit it is. Are there any slashdottees that would like to proofread my replies?

      Nah, didn't think so :)

  9. Why should GWT be on my radar screen? by scottsk · · Score: 2, Insightful

    Does the book - or somewhere else - address why GWT ought to be on my tla radar screen? Does it work with Apache, or just J2EE containers? Is it open source? I know I could find that out by, um, googling the information, but if the book is meant to evangelize the tla, I would have expected it to concentrate more on why I should use GWT and in which situations, not how to build a tic-tac-toe game.

    1. Re:Why should GWT be on my radar screen? by myatmpinis1234 · · Score: 1

      It works with apache or any other web server. Basically it just generates javascript which can be hosted anywhere. As for the backend for RPC and server calls for data, I think that's just java based, but works with Tomcat. It's open source. I've done AJAX apps with hand-coded javascript, with toolkits like prototype and yahoo, and with GWT, and IMHO, GWT is pretty nice. Of course that sidesteps the question of whether web apps should be all AJAX'd up, but if you do take a strong look at GWT.

    2. Re:Why should GWT be on my radar screen? by nuzak · · Score: 1

      > Does it work with Apache, or just J2EE containers?

      It is a servlet, so it works with servlet containers. Like tomcat, resin, jetty, or those big ol JavaEE containers.

      I'm not sure that tells you anything about why to use it though.

      --
      Done with slashdot, done with nerds, getting a life.
    3. Re:Why should GWT be on my radar screen? by Anonymous Coward · · Score: 0

      It works with web services as well, so you may run anything on your server as long as it supports web services... it's just a bit easier (fewer steps) with RPC.

    4. Re:Why should GWT be on my radar screen? by Anonymous Coward · · Score: 0

      If you have to build a fairly complicated UI and deploy it in a browser and you feel more comfortabe building traditional desktop apps (for instance with Swing) than GWT is a good choice and should be on your radar.

      If you have never written a desktop app and you are used to using Struts or similar webapp frameworks than GWT is going to be a huge learning curve. In this case, I would study the design patterns used to build good Swing apps (Actions, Listeners, etc) and apply that to GWT or just stay away from GWT.

    5. Re:Why should GWT be on my radar screen? by Anonymous Coward · · Score: 0

      If (1) you already know Java, and (2) you are developing a web app with anything other than the bare minimum of functionality that you get with HTML + CSS then it should be on your radar.

      It is not like Struts or JSF - it isn't tying you to a J2EE container. GWT pushes the 'rich client' stuff back down to the client.

  10. Oops. by Limburgher · · Score: 1

    I thought they said GWOT. My bad.

    --

    You are not the customer.

  11. I want to write desktop apps with JS/GWT/whatever by joe_n_bloe · · Score: 2, Interesting

    Some day, I'll be able to use a browser to write desktop apps without resorting to plugins or XUL or whatever. No, Google Gears doesn't do that.

    JS is a great language and GWT is a great tool, especially the hosted development environment. But it will never reach its potential until it is a general purpose application programming language.

  12. Just when you need mod points by WarwickRyan · · Score: 1

    Spot on, that's a really terrible summary. It's like a reverse summary really as there are few to no IDEs which come close to Visual Studio. Even Eclipse, for all its niceness doesn't compare well. Which sucks, as I spend most of my development time working with Eclipse and its variants.

    1. Re:Just when you need mod points by owlstead · · Score: 1

      "Even Eclipse, for all its niceness doesn't compare well. Which sucks, as I spend most of my development time working with Eclipse and its variants."

      Funny, that, I am using both as well, and I feel the same thing. The other way around. VS is way behind Eclipse on some features, and a lot more on others. VS 2005 now has acceptable support for operations on the abstract syntax tree, but nothing really powerful. Of course, VS has more functionality integrated. But Eclipse has its vast number of functional plug-ins, and it does the parsing and code completion exceptionally well. Anyway, I've to spend most of my time on Eclipse - and that's the one that *I* like - so it seems I got the better deal.

  13. Its called pike. by Anonymous Coward · · Score: 1, Interesting

    "The first thing I'd like are some of my favorite features from Common Lisp, like first class functions, ability to do procedural, functional, and object oriented programming with the same language, dynamic typing, macros, closures, and lexical scoping.

    Having a C-like syntax would be good for people who are used to C or Perl and don't want to learn about s-expressions. Automatic memory management is a must."

    You just described pike (although it has both static and dynamic typing).
    http://pike.ida.liu.se/

  14. It's so simple, but... by C10H14N2 · · Score: 1, Troll

    Use GWT's Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server. ...provided you have some other server capable of running the necessary services to put the A&X in AJAX, which raises the rather obvious question: what does this simplify again? So it's JSF-lite, except I have to roll my own SOAP services for everything?

    Hell. No.

    1. Re:It's so simple, but... by Eponymous+Bastard · · Score: 3, Informative

      I looked into GWT a month or two ago. From what I understood, you can write both client and server code in Java and then GWT compiles the client to Javascript and the server to a servlet.

      You don't actually write any SOAP code, but rather use Java Remoting to call across the wire, getting a Java object back that you can manipulate. The GWT compiler translates that into a XML request and writes all the serialization/deserialization code and so on. In fact it doesn't seem to be able to call an XML web service at all (that's the reason why we didn't pick it up for our UI, our company does business logic in C#).

      Since it is also a widget library you should be able to have complex widgets with multiple DOM elements and access them as a unit. You could write your own javascripts objects to access the DOM, but then it's basically a GUI library.

      As far as I can tell, the whole point is to write both client and server with a single language and interface, which is very useful.

      For example, in our case, the pages are generated with ASP.Net in C#. If we want to disable a button when the page is served we do buttonSubmit.Enabled=false; but if we want to reenable it without a postback, we have to add javascript code to find the DOM node for the button and then enable it. Imagine how messy it gets when you want to add a row to a datagrid. After a while you can't tell all the interactions in the GUI handling logic. I'd love to have something that allows me to write an event handler where I can just write "buttonSubmit.Enabled=true;" and let the compiler work out all the DOM walking code.

      So you have three choices:
      - Serve the full page (formatted in server side language) and then tweak it in javascript, relying on knowledge of the widget library's rendering.
      - Serve a bare bones page and do all the GUI in Javascript, both initial and updates. Let the server handle business logic only. I see some posters have suggested moving the initial javascript rendering to the server.
      - Serve a full page and let something like GWT convert the client side code from working with the same objects as the server to a working Javascript/DOM implementation. This is the approach GWT is taking.

      Of course, I only looked at it for a couple hours, so someone will probably tell me all the ways I'm wrong.

  15. You seem quite confused. by Anonymous Coward · · Score: 1, Informative

    Languages don't have performance characteristics. They can't be faster or slower than each other. Only implimentations of languages are faster or slower. For instance, the mozilla implimentation of javascript is very slow, rhino is not as slow, but still slower than the official implimentation of python, and most other reasonable language implimentations. I am not aware of any javascript implimentation that comes even close to the performance achieved by high performance implimentations of pascal, miranda, scheme, or common lisp, much less languages with very fast implimentations like ocaml, C++, C, D, etc.

  16. Very nice toolkit with some problems by plams · · Score: 3, Informative

    The content on Google's GWT site almost speaks for itself concerning the power of it, so I'll elaborate on some negative aspects I've encountered.

    I went to explore the possibility of a non-servlet based backend and very quickly encountered problems that are not really GWT's fault but a side effect of having a hosted environment: the browser is based on Mozilla and thus inherits the security restrictions of it. I could not make RPC calls to my backend web server because Mozilla disallows cross-domain access. I spent a lot of time trying to circumvent this, and did find some work-arounds but nothing that worked to my satisfaction (too cumbersome). GWT should offer a modified Mozilla with these restrictions removed, or even better, adopting Flash's excellent practise of looking for a crossdomain.xml file in the root of the target webserver (to see whether access is allowed or not).

    Also, developing on an AMD64 based Linux I discovered that the hosting environment just doesn't work running from a 64bit JVM. Setting up a 32bit JVM isn't that difficult, but it's not a good solution (However, I talked to a GWT developer on IRC who claimed this issue was high on their priority list).

    Lastly, GWT is a nice environment, but it's still a bit young. It seems stable enough, but if you engage in a large GWT based project you may find yourself doing a lot of low-level client-side code unless their limited palette of widgets and other client-side features completely cover your needs

    1. Re:Very nice toolkit with some problems by owlstead · · Score: 1

      "GWT should offer a modified Mozilla with these restrictions removed, or even better, adopting Flash's excellent practise of looking for a crossdomain.xml file in the root of the target webserver (to see whether access is allowed or not)."

      Distributing a specific web client to make it possible to view (some) web applications? That's not a good idea. Maybe for intranet use, but people won't go for a specific web client just to view some GWT based websites. The idea of a crossdomain.xml for use within JavaScript is an interesting one though.

      "Also, developing on an AMD64 based Linux I discovered that the hosting environment just doesn't work running from a 64bit JVM."

      Weird. Just for my information; I assume there are some native parts involved? I could not find any info on that.

  17. Google DB/LDAP API? by Doc+Ruby · · Score: 1

    Is there anywhere I can find out how to make the Google DB accessible to software that can query only an LDAP API?

    --

    --
    make install -not war

  18. Shameless plug - chess board diagram composer by SashaM · · Score: 3, Interesting

    Just a few hours ago I finished a small, mostly-for-fun project in GWT, and now I see a GWT-related story on slashdot. Surely it's not a coincidence and therefore I must pimp my project: a chess board diagram composer.

    1. Re:Shameless plug - chess board diagram composer by Man+On+Pink+Corner · · Score: 1

      Nifty. Are you going to release the source?

  19. Here's the point of GWT... by Anonymous Coward · · Score: 0

    If you have a team of Java developers who want to do pretty UI's and AJAXy things, GWT is a framework that lets you use Java to do that, IE: you use your strengths. It makes complete sense too -- essentially a web browser is treated like a compilation target. Kinda like writing C code that then builds assembly, rather than having to hand code the assembly yourself.

    Anyone who has maintained a pile of Javascript for a few years understands the problem with hand coding javascript and/or the alternative javascript frameworks on the market right now -- lack of good IDEs/debuggers/tools like for other languages, among other problems. GWT counters this by allowing you to work with Java, and providing tools that integrate with your current toolset -- Intellij, Eclipse, NetBeans, etc.

    Personally, I will be surprised if this model isn't the way we are all doing browser development within the next 5-10 years -- write your code in one high-level language and have it compiled into a given target (IE: turned into js, css, html, etc). This is exactly what has happened in the evolution of computing languages over the past 50 years, why shouldn't it happen in the web?

  20. Plug for Rob Hanson by jerry2a · · Score: 1

    So glad to see this article on Slashdot. I've been a co-worker of Rob Hanson's since 2000 and in the near 20 years I've been in the biz I've yet to meet a better programmer. I'm no longer a developer and I haven't read the book yet (thanks for the free copy, Rob...not) but knowing his knowledge and dedication I can only assume that it is nothing short of excellent. Carry on...

    1. Re:Plug for Rob Hanson by johnharrisyankee · · Score: 1

      Well, this is a plug for rob hanson's friend.... who i know not,
      but I agree with him :)

  21. this and that by SanityInAnarchy · · Score: 1

    It's actually not braindead. It makes a lot of sense, when you understand in more detail how javascript works...

    But look up Douglas Crockford. He had one way of solving this: var that = this. Since Javascript supports closures, you can then refer to that, even in nested functions in which "this" gets overwritten.

    --
    Don't thank God, thank a doctor!
  22. Silverlight better by Crazy+Taco · · Score: 1

    The writer of the review talks about how server side languages have a richness benefit, but client side languages, while less powerful, benefit from a wide installation base due to being included in web browsers. He talks about how GWT tries to bridge the gap, but I would recommend getting a book on silverlight, reading it, and using that instead. The current 1.0 version of silverlight is mostly just good as an online media player, but the 1.1 alpha version bundles a version of the .Net framework. Therefore, all that power you get from the .Net framework on the server side, you can ALSO get on the client side. And silverlight is cross platform. There've been a number of these "bridging" technologies that try to bridge these gaps, but silverlight definately looks more useful than GWT.

    --
    Beware of bugs in the above code; I have only proved it correct, not tried it.
  23. PHP has classes... by SanityInAnarchy · · Score: 1

    I mean, there are plenty of things to hate about PHP, and even object-oriented PHP, but you can no longer complain that it doesn't have namespaces.

    And Javascript is just far too flexible not to let you hack together namespaces on your own. Watch this (sorry about the lack of indentations; stupid Slashdot):

    var mynamespace = function() {
    var privateNSvariable = 'foo';
    function privateNSfunction() { ... }
    var that = {
    publicNSfunction: function() {
    I can access privateNSvariable or privateNSfunction(), and I can also do that.publicNSfunction().
    },
    publicNSvariable: 'foo'
    };
    return that;
    }(); // call the anonymous function. mynamespace is a singleton object, not a class.

    // Now we can call it like so:
    mynamespace.publicNSfunction();
    // Or do things like this:
    someHandler.onSomeEvent = mynamespace.publicNSfunction;
    // If we're writing a library, and people don't like our naming convention:
    var yournamespace = mynamespace;
    yournamespace.publicNSfunction();

    I highly recommend reading Douglas Crockford if you don't already know about tricks like this. From what I can tell, he's pretty much written the book on best practices in Javascript.

    Javascript is at least as powerful as Ruby, if not more so, and the syntax feels a lot cleaner. But it has been awhile since I had to do any Ruby, too.

    --
    Don't thank God, thank a doctor!
    1. Re:PHP has classes... by fireboy1919 · · Score: 1

      Yes, obviously. I've been doing that for years. It's not real namespaces. You can's easily load & remove them like its nothing as part of the core language; you have to rely on tricks.

      More importantly you have to rely on library writers adhering to this design pattern. It's just something tacked on, so very few of them do - mostly only the aforementioned modern pure javascript libraries that are trying to fix the problems with the language (Dojo, Rico).

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    2. Re:PHP has classes... by SanityInAnarchy · · Score: 1

      You can's easily load & remove them like its nothing as part of the core language; you have to rely on tricks.

      These "tricks" are not difficult, as I've just demonstrated. In fact, you could probably implement something like Java's "import", if it's not there already. You can certainly do things that Java doesn't let you -- for instance, you can rename a namespace, as I just demonstrated.

      So in what way is it "not real namespaces" other than not being a part of the language? (Because that buys you nothing -- most of Ruby, for example, is written in Ruby.)

      More importantly you have to rely on library writers adhering to this design pattern.

      News flash: Libraries don't always behave the way you want. News at 11.

      It doesn't prevent you from using namespaces in your own projects, and if you must use poorly-designed libraries, you can still do so. It's a bit like writing a C++ project and calling C code. Or, hell, it's like writing a Java project and calling C code.

      Speaking of which, C has done fairly well without namespaces at all. They stick to naming conventions. I'm not saying that's better, but I don't see namespaces as such a crucial feature anymore.

      --
      Don't thank God, thank a doctor!
    3. Re:PHP has classes... by fireboy1919 · · Score: 1

      These "tricks" are not difficult, as I've just demonstrated.

      Neither are the many ways of doing OOP in perl, but you don't see a lot of perl packages that do that. I write my code that way, but that's not the issue.

      The issue is the mountains of old javascript out there that would have to be refactored if we wanted to get them to start using namespaces. This isn't really changing, either. Lots more javascript is being written every day that doesn't use any kind of namespace methodology at all.

      News flash: Libraries don't always behave the way you want. News at 11.

      You're obviously implying that it's inappropriate to expect that from a library. I've never heard of a perl library in CPAN that wasn't in a module (i.e. encapsulated in a namespace). Same namespace thing with ruby, Java, python, C#. These languages have namespace mechanisms built-in, so ALL libraries have at least this behavior. Why should I have to expect less from javascript?
      "Because namespaces weren't built-in to the language" is a pretty lame excuse, but it is the reason, and a reason to not think of javascript as much beyond a toy.

      and if you must use poorly-designed libraries, you can still do so. It's a bit like writing a C++ project and calling C code. Or, hell, it's like writing a Java project and calling C code.
      This is a straw-man argument. A library isn't necessarily poorly designed just because it doesn't include namespaces. At least, it isn't considered poor design by most, or there would be less libraries that have this problem. Further, it is difficult to argue the connection between poorly designed javascript+other javascript with code written in one language+code written in a different language. Namespace cluttering is a much simpler technical challenge than the one you're presenting, and can be avoided much more easily through language design.

      Speaking of which, C has done fairly well without namespaces at all.
      I disagree. C code takes forever to write, and this is part of the reason. You can't use massive sets of C libraries together, and you need to make sophisticated tracking system to track the usage of libraries because of this problem.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    4. Re:PHP has classes... by SanityInAnarchy · · Score: 1

      Neither are the many ways of doing OOP in perl, but you don't see a lot of perl packages that do that.

      That's odd. Almost all the ones I use at least provide an OOP way of doing things, even where it doesn't really make sense (things like Data::Dumper).

      XML::SAX. Mime::Entity. WWW::Mechanize. DBI. Archive::Zip... the list goes on.

      Maybe a lot of perl programs don't, but just about every CPAN module I've ever used does, even in cases where it really doesn't make a lot of sense.

      The issue is the mountains of old javascript out there that would have to be refactored if we wanted to get them to start using namespaces.

      Well, that had to happen with Perl. Perl didn't always support OOP.

      You're obviously implying that it's inappropriate to expect that from a library.

      No, I'm implying that it's not a valid criticism of the language that a library doesn't behave the way you'd like. If you don't like that library, use a different one.

      I've never heard of a perl library in CPAN that wasn't in a module (i.e. encapsulated in a namespace).... These languages have namespace mechanisms built-in, so ALL libraries have at least this behavior.

      Well, no. I don't know exactly how CPAN works, but it does have rules about what's accepted, including documentation.

      There are certainly Perl libraries outside of CPAN that don't do this. They just aren't very common -- if you want your Perl library taken seriously, you put it in CPAN. But that's a feature of the community, not the language.

      Why should I have to expect less from javascript?

      Because Javascript has no CPAN.

      Also, because Javascript was designed to do little things like rollovers and form validation, so for years, that's all people thought it could do. AJAX has finally forced people to start taking it seriously, but there are still a lot of old coders out there writing crappy javascript, just as there are a lot of people out there still using the <FONT> tag.

      I also fail to see how including it in the spec would solve anything. All it would do is break existing browsers until they all support a "namespace" keyword, and create yet another feature that would be ignored by most developers -- the ones who don't use namespaces wouldn't notice. The ones who do use namespaces would continue to use the functional "hack", because it's just as good, and it's supported by old browsers.

      Further, it is difficult to argue the connection between poorly designed javascript+other javascript with code written in one language+code written in a different language.

      I don't see the distinction here.

      We didn't always know Javascript could do namespaces. Then someone discovered them. Realistically, we should start using a different name for well-designed Javascript...

      And C++ is C with classes. It is possible to call C from C++ not because of any mysterious voodoo like that involved in calling C from Perl or Python, but because C is a subset of C++. In fact, if you think object-oriented design is a good idea, then just about every C library is the equivalent of poorly-designed Javascript libraries that don't use namespaces -- because C++ does support namespaces, and g++ is available pretty much everywhere gcc is.

      And yes, I could even go far enough to justify "calling C code from Java" -- last I checked, the Java runtime is written in C, even if parts of it are written in Java. Therefore, any C program that doesn't also use Java could be seen as a C+Java program that doesn't use namespaces/GC/classes/interfaces and all the other nice features of Java.

      The fact that good Javascript is so rare doesn't reflect poorly on good Javascript. It does mean that it's not a very popular language, but it does have pretty decent tool support in the form of IDEs, debuggers, and web browsers to deploy on.

      --
      Don't thank God, thank a doctor!
  24. Half-true. by SanityInAnarchy · · Score: 1

    In theory, any language could have a sufficiently good compiler to make it as fast as any other language.

    In practice, the more powerful the language is, and the simpler a naive interpreter is, the harder it can be to make a good compiler.

    Consider JavaScript -- you have to carry around enough baggage to be able to support random 'eval' statements. Or Perl -- common wisdom dictates creating classes as a hash table, because there's no such thing as actual object members in Perl. Technically, you could make a Perl object that's as fast as, say, Ruby or Python objects, but it requires some brutal hacks -- and since OO in Perl is already a brutal hack (though a bit beautiful, too), you know this is going to hurt.

    Ruby must store and lookup all function and variable names at runtime as strings, in order to support things like the default method -- which is a method that gets called when it can't find a given method, with the name of that method as a string argument.

    It's theoretically possible to make these languages faster, but in practice, I've found that things like Jython usually end up supporting a subset of the language and not providing much of a speed boost. Of course, that's mostly just a "feeling level", so I could be way off here...

    I think that Javascript, Ruby, and friends could all be made faster than C. It's just going to take a kind of JIT compiler that I don't think anyone's seen before.

    --
    Don't thank God, thank a doctor!
  25. Inheritance... by SanityInAnarchy · · Score: 1

    Like many things, this can be hacked to be better in Javascript. Crockford's idea of a "superconstructor" is actually really useful, I think.

    --
    Don't thank God, thank a doctor!
  26. Really action in GWT by Anonymous Coward · · Score: 0

    Take a look on Wibokr, wibokr.com. There is demo available. Wibokr is 100% GWT-based wiki system.

  27. Wicket documentation by gwynevans · · Score: 1

    While not disagreeing that product documentation could be better, have you seen the Wiki, and particularly http://cwiki.apache.org/WICKET/documentation-index .html ?

  28. There is also ULC by master_p · · Score: 1

    which I believe it is better than GWT, although not entirely similar (much better than echo2 though).

  29. GWT in Python and Ruby by egghat · · Score: 2, Informative

    My major gripe about GWT ist the use of Java, which I never liked.

    So I want to give oyou two pointers to projects that could need help to transfer the idea of GWT from Java to Python and Ruby:

    Python: pyjamas - build AJAX apps in Python (like Google did for Java).

    Ruby: Blog Entry from Michael Neumann, who tries to port GWT to Ruby.

    The Ruby stuff is in the very early stages ...

    Bye egghat.

    --
    -- "As a human being I claim the right to be widely inconsistent", John Peel
  30. Client-Side IDEs ?? by Anonymous Coward · · Score: 0

    So he is saying he likes Java right? That's why he thinks it has a better IDE than say Visual Studio ?

    It's no biggie, but it seems the use of client-side vs server-side as an intro to his article was a bad choice. That just doesn't make a lot of sense. I think he should have clarified that he is explicitly talking about web based development only and not say Java applets compared to VB/SQL. He just should say something like web based client-side development or something because a 'client-side' apps are developed in the likes of Visual Studio, which you'd have a very hard time quantifying that comment suggesting that Java has a good IDE, compared to what ... notepad ?

    Cmon, C# is still shiny it's so new and it's IDE is already better than anything I've seen for Java, though ultimately the IDE need but be functional and user can adjust. Still this is a bad choice in terminology and even though it appears we are entering the web-centric world, I have my doubts that we will live up to this manifest web-centric destiny. Meaning, don't forget that non-web based programming isn't dead yet. Java may be the most popular modern language out there and certainly the most popular web language, but it's main advantage is by far being the first to the game not being led by a great company or community. I say Java IDE's suck and are only just IDE is a mistake and will eventually be changes. There is no real need for multiple competing non standardized IDE's, especially when none of them are making a lot of money. This is a major weak point for Java and with the realization of .Net stacking up against the slow pace of Java's early development I still have little faith in the language. Some of the worse viruses I've gotten came through my Sun Java folder and their updater splash screen shit is just annoying. It's just the best you got, it's not the best. Perhaps right now the biggest problem with Java is that it's become the standard teaching language meaning we have a huge proliferation of slow running cross platform apps that mostly run on windows anyway.

    I don't know about you guys, but the thrill of google is just about over for me. Their web search result accuracy has dropped considerably for a lot of topic and you can clearly see they are censoring and failing to check the majority of their sponsers. That's not going to last. Web search wise, google has entered the decline and I guarantee that cannot change. You can only be THE ONE for so long until everyone catches onto your game and then ruins your search engine by exploiting it's ability to find on topic content vs finding the content you pay the most to have listed the highest.

    Riiight, so the only good web search has to be one run without sponsors and one that can resist the developing of business who exist only to skew your results as a service to other businesses looking for better advertising. Now, how to do that is beyond me, but google needs a new real product beside their search. Right now I see their collaboration tools as their best offering, though online office apps that don't suck would be nice also.

    Really what's the hold up there, how long can it possible take to emulate MS Office and Outlook via the web and why wouldn't everyone and their mom want to be the first ones out there with a good looking and functional version of this. It's ridiculous that people are using things like Open Office, I mean Corel certainly offered more features 10 years ago than Open Office offers and with no worse of a look or interface. It's just a clumsy, feature lacking and sadly slow suite. You really can't expect to compete with a product as underdeveloped as Open Office. Their is no way someone can't put all the functionality of Open Office into an online suite of office apps years ago. It's just not being serious done. Lots of companies are making half assed attempts. I think they seriously don't see the long term profitability in owning corporate america's office suite choices. Though I know corporate america i

    1. Re:Client-Side IDEs ?? by sproketboy · · Score: 1

      You have no cred posting this lameness as an AC. Visual Studio is primitive compared to IntelliJ.

  31. Hamlets (hamlets.sourceforge.net) by Anonymous Coward · · Score: 0

    Are you in need for an easy-to-use, easy-to-understand (less than 1/2 hour), servlet-based framework to write your simple web-based applications? If so, have a look at Hamlets (http://hamlets.sourceforge.net). Hamlets is an open source framework with BSD license that allows you write your web applications entirely in Java. No Java in the HTML, no HTML in the Java, instead strict separation of content and presentation. Hamlets is simplicity and speed.

  32. Point of existence by JochenBedersdorfer · · Score: 2, Interesting

    One of the most important points for using something like GWT has been missed: You can write test code for GWT very easily! If you ever tried to debug a mid-sized Javascript application, you know what I'm talking about. With GWT you have a hosted environment that makes debugging much easier. Also, you can employ Test Driven Development much easier. There is even explicit support for JUnit in GWT. For your favourite toy web application, GWT may be overpowered. For massive, distributed internet applications who need to involve the client side as much as they can, GWT currently is the best solution for Java shops.

    1. Re:Point of existence by nolman · · Score: 1

      Um I am a XP developer and when I used GWT I found that it hindered TDD. Their test framework was awkward as hell to integrate and it was slower then shit. 10 seconds of setup and 10 seconds of teardown is completely unacceptable. As a result we needed to create extra layers of separation to let our test suites run in a reasonable amount of time. The rails platform was developed with TDD in mind, so their tests take about 0.05 seconds for setup and teardown. When compared to a framework like rails GWT shows very clearly how it was not developed with common problems faced in mind. Take for example implementing validation, in rails it is 1 line of code in the model and 1 line of code in the view to show validation messages. Now in GWT to get this same functionality you need to implement the whole validation system tits to toes. There are so many other points to be made against GWT, no MVC structure out of the box, if you want to know how changes actually look on a page you can't trust the hosted environment. It actually behaves quite differently then ie7 once you get really deep into it. So if you want to change the position or color of a button, depending on your code base say hello to 1-10 minutes of waiting. I could continue to go on about how awful GWT is but you should just take my word for it and try Rails instead. You will be much happier.

  33. Re:I want to write desktop apps with JS/GWT/whatev by JohnnyCannuk · · Score: 1

    Well, how about Adobe AIR?

    If you read Ajaxian, you might have heard about this a long time ago. Its essentially the AJAX version of Java Webstart.

    --
    Never by hatred has hatred been appeased, only by kindness - the Buddha
  34. Started with Perl-CGI, went to OO by StCredZero · · Score: 1

    I started with Perl CGI. Take a look at Django or Rails. The Java implementations have been way too heavy.

    My guess is that you have been polluted by bloated Java implementations, and still only have a foggy idea of what OO is. True, OO is just a set of ways to organize and think about code along with its data. But if done right, it increases the effectiveness of your organization a lot. And like procedural programming, it can also be done wrong and cause misery. If you want to investigate something, you need to find the best examples of it. And to do that in OO, you can't *just* look in the Java world. There is much fine OO in the Java world. But it is only one slice of a larger pie. This is especially true for Web Apps.

    1. Re:Started with Perl-CGI, went to OO by kisrael · · Score: 1

      Took a look at Rails. Clever, but couldn't really wrap my head around its use beyond CRUD...

      The "foggy idea of what OO" is is a fairly damning accusation. I've had a decent academic background in the early 90s, and have been doing Java since 2001. So if I don't know it by now... it's also a hard charge to refute, because even a demonstration of an understanding of the basics can lead to "well sure you know that, but you don't REALLY get it"-- and once the other person claims that high ground, they never have to give it up.

      (Again, I think http://www.geocities.com/tablizer/oopbad.htm makes the case that OO *is* oversold -- but the idea "more OO is better than less OO" becomes a matter of faith, and so jsut saying "OO is OK" doesn't seem like enough, and you seem like some kind of cretin who just doesn't get it.)

      And the thing is, it's not like I think Perl is the end all and be all, and there are times I desperately wish it had a stronger object model... even the syntax for nested arrays etc ain't great, and there are definitely times where delimited strings and hashmaps will reach their limits.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    2. Re:Started with Perl-CGI, went to OO by StCredZero · · Score: 1

      There's a lot of so-so OO in academia. (A lot of what I see is downright horrific!) And just because you've been doing Java, doesn't mean you've been exposed to good OO. Heck, I've seen plenty of procedural programming in Smalltalk. (I even saw guys who tried to use a Smalltalk image build process like they'd use make and a compiler. Just wrong!)

      http://www.geocities.com/tablizer/oopbad.htm -- this guy is a bit of a nutter. Seen his stuff and traded posts with him before.

      If, as you say, there are *times* Perl had a better object model, and *times* where delimited strings and hashmaps reach their limits, then you are on the right track. Trust me, there is more!

      What is "good OO" in the wrong context can be pernicious, just like good procedural programming in an OO project can be. Just about the only good way to learn good OO is to be mentored in a project where it is being practiced. Again, trust me, there is more. Go and search. Read the beginning of Martin Fowler's Refactoring book and go through the video store example. That's one of the things that made the light bulb go off for me.

    3. Re:Started with Perl-CGI, went to OO by kisrael · · Score: 1

      So, a topic that will come up on the wicket board: do you think inner classes are a positive, negative, or neutral sign of thoughtful OO?

      I'm not sure if you mistyped, but I said there are times I wish Perl had a more sane object model.

      The thing about the oopbad guy is... he makes some very fair, and almost inarguable points, even if you don't agree with the gist or the conclusion. People in his camp view OO enthusiasts as zealots of a specific, unshakable but not 100% justified faith, and people in the OO enthusiasts camp view him as something akin to the conspiracy theorists, full of odd little points, but it's too tiring to rebuke those points *en masse* because you don't think you'll convince him anyway.

      And it's not like I'm in the oopbad camp anyway. And with enough stretch and strain, you end up kind of saying it often comes to be similar to the same thing, whether it's the fact that OO of course relies on procedures, or the way a Perl script and its output webpage can kind of be viewed as a kind of sort of object, or at LEAST an encapsulated "thing" with definitive inputs and outputs, and data and code being stored together.

      I mean often, the issue is what flavor of OO to use; I mean, I think the recent emphasis on "prefer encapsulation to inheritance" goes against the grain of mediocre enthusiast OO.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  35. Sweeping dirt under the rug by aleKsei · · Score: 1

    From what I've seen GWT and other frameworks are just sweeping the dirt under the rug. The reason web apps are the Frankenstein of software apps is because they are layered on a protocol which wasn't designed for that purpose.

    1. Re:Sweeping dirt under the rug by cnystrom · · Score: 1

      You are exactly correct. It is a shame. The success of the web is actually holding the Internet back.

  36. Re:I want to write desktop apps with JS/GWT/whatev by cnystrom · · Score: 1

    > But it will never reach its potential until it is a general purpose application programming language.

    Why not use a general purpose application programming language like C to create internet apps?

    http://www.newio.org/