Friday, December 15, 2006

A Proof That JavaScript Sucks.

Google developed GWT.

Why would GWT be so well acclaimed if JavaScript was a good language. When you talk about GWT to someone (a developer preferably), the first reaction is often
"great I don't need to do any JavaScript".

I recently discovered another similar open source project, ZK. The first thing you can read on the website is
"ZK is an open source Ajax Web framework that enables rich user interface for web applications with no JavaScript and little programming."

If you compare that with how JRuby is (or Jython used to be) trendy, you will agree there must be a problem with JavaScript.

JavaScript is not bad at everything, for very simple scripting, it is quite decent, the recent inclusion of Rhino in the JDK 1.6 is useful anywhere you need simple dynamic behavior. But most developers obviously don't want to deal with it.


17 comments :

  1. It's important to separate the language from the platform. JavaScript, the language, has some nice properties. JavaScript, in its typical home in the browser, can be pretty awful -- particularly when IE comes into the picture.

    (Likewise, I have a strong dislike for Java, the language, but I think that Sun has done some amazing things with the platform.)

    ReplyDelete
  2. Fabien, I use to read your blog because on a normal day you know what you are talking about.

    There are zillions of examples about writing pages in Java without Java: JSTL, EL, workflow engines, etc. Lots of ways of producing HTML without knowing HTML, and XML, etc. That does not make a language a poor decision.

    You found two AJAX frameworks (btw, zk is crap) that claim not to use javascript. Have you seen any AJAX GWT interfaces out there lately? Out of Google, DWR, prototype and dojo are the norm.

    We developers are lazy to learn another language, more if it's a loosely typed one. The GWT guys found a good way around the inability to test javascript stuff.

    Reaching further conclusions seems like going too far.

    ReplyDelete
  3. Ignacio, the post title is probably exaggerated and there lies the misunderstanding. The message I wanted to convey in this post was about JavaScript being mostly viewed as painful by developers.

    Dojo, Prototype are really good libraries and I admire their developers for being able to deal with JavaScript so well, but tell me if you know many people saying they love JavaScript and they want to do more of it. Then replace JavaScript that with Ruby/Python and see you won't have the same answers.

    Now you are right that GWT goal is not to go away from JavaScript but, yes, to provide testability and natural Java integration. In this regard, you join kevin comment about JavaScript as a platform "sucks" (for now). And there is a good counterargument to my analysis (if I omit the "platform" word after JavaScript): what's going on on the Flash front.

    ReplyDelete
  4. Agree then :) You are right, javascript leaves lots of room for improvement.

    Anyways, I must say I have done quite some things in Jython and found javascript easier to deal with (I suppose it's because I expected less of it).

    Have a merry Christmas, Fabien.

    ReplyDelete
  5. I love coding in Javascript. It's a powefull language.

    I have to use GWT in a project lately. I was astonished how it sucks.

    GWT generate ugly tables and ubfuscated javascript. It's for java brainwased people that are to lazy to learn another language and don't give a clue about how web works.

    I reconize one asset to GWT : It's not as bad as ASP.NET.

    ReplyDelete
  6. I support anonymous. Saying that javascript (and not java. ignacio, what the hell are you talking about?) sucks, I ask you first to show me one of your scripts. I can bet all my fortune and all my futur life as a slave that you didn't even use object concept. and if you used prototypes, probably it's by coincidence or copy-paste without knowing why.
    Learn how to do objects&prototypes, learn DOM, learn ajax, have good tools(eg. firebug) and take over the world, damnit!

    ReplyDelete
  7. To the anonymouses:
    - I don't see how you can compare GWT and ASP.NET. And compared to JSP, ASP.NET is not that bad.
    - I did program the with Objects and Prototypes in Javascript, even though Javascript is not purely OO. Javascript does not have the notion of classes like C++ or Java, but it is based on the notion of prototype. That is why many qualify it as Object Based and not Object Oriented. I would advise people not to try to do too much OO in Javascript, it is better to have a Functional language programming mind, rather that to try to fit everything in OO, when your base language is not a purely OO language.

    ReplyDelete
  8. You want to know what sucks?

    Letting someone else write scripts and have them run on your computer, via a BROWSER.

    If you got some great script, then let the user decide if he wants to download it and run it.

    I get all the fucntionality I need out of shell scripts and STANDARD UNIX UTILITIES (they still work and provide as much power as anyone could need).

    From the internet want CONTENT. Not some silly scripts in some trendy high level language THAT CAN ONLY BE RUN INSIDE A BROWSER, which I cannot control.

    Fer chrissakes, people can type short strings of text into a blank screen on their cell phones; doing the same thing on their computer is not unfathomable.

    Stop with the high level language nonsense (it's not wonder people argue about it: making people work in these areas is TORTURE unless you have been lobotomised)Teach people some commands and let them use their machines and stop trying to impress people with javascript wizardry. Users do not care; they just want things to WORK and LOOK COOL.

    Sorry for the rant but I just had Mozilla FF 3.0 pretty much EXPLODE on me (replicate into a zillion windows). I rarely EVER use these silly graphical browsers and that's why! Mobile access is forcing some of the web to SCALE DOWN. Thin clients (=terinals!)are coming back.

    Goodbye web scripting. We do not need you.

    Fire up the 1996 NCSA Mosiac and look at the speed and features. Tehn look at Chrome. Wake up! All this scripting is NONSENSE.

    Content is KING.

    ReplyDelete
  9. At anonymous: Don't want scripts running in your browser? Fine, don't use them. JS is easy to deactivate. Or just use Lynx. You have the choice.

    I find client-side scripting perfectly fine.

    ReplyDelete
  10. GWT SUCKES BIG TIME!!!
    Any tool kit suppose to easy things not make it thougher..the whole idea behind GWT is the make it more easier for JAVA developers..and the fact is..it's a nightmare..in simple words..I can develope a page faster using Struts(Jsp / Servlets) than with GWT.
    And some of you idiots..GWT stands for Google web TOOLKIT..it's a TOOLKIT..to create nice widgets..and use it with regular html..dont try to use it as a FRAME WORK..it sucks as a framework..actually it's not a framework at all and you can't (should not ) develope your entire app in GWT..or you will be in a hell..trust me..our company is using it as framework (some idiot brought it in and quit the job) and now we all are suffering..it eats up 10 times more development time than traditional JSP/Servlet structure..a
    all I can say is..stay away from GWT nightmare..it sucks big time

    ReplyDelete
  11. i feel you viral patel...cause i'm in the same fxxk up situation as you are now...screw gwt

    ReplyDelete
  12. "I rarely EVER use these silly graphical browsers and that's why"

    I agree that people take graphics too far, often to the point of distraction. When I go to a site, I too am looking for the raw textual information I want, but there is one use for scripts you might be missing: partial page updates. AJAX (JavaScript) is pretty useful in refreshing part of a page so that the whole browser window doesn't refresh and jump back to the top of the screen. That can be handy.

    ReplyDelete
  13. You're not being fair. JavaScript is a decent language. You have to treat it as Haskell's mildly retarded cousin instead of a sort of crippled Java, though. If you treat it as a functional language it can be very, very potent. It has an almost LISP-y ability to transform itself that's actually really, really nice to work with. I love JavaScript's ease of using closures, recursion and anonymous functions, and functions as first class objects!

    It's this great power which makes the variety of JavaScript libraries out there possible which ease the task of cross browser scripting (i.e., differences in DOM implementation and events) and allow some amazing effects.

    Cross browser work does suck, which is not JavaScript's fault. However, using libraries suck as jQuery can completely alleviate that kind of pain as well as make working with the DOM considerably easier. jQuery is definitely my favorite JavaScript library out there, as well as being the one which currently has the most momentum... and I believe that it is because uniquely among the JavaScript libraries it is not trying to "fix" JavaScript and make it behave more like another language (but the fact that you can mutate JavaScript this way is a clue that JavaScript actually doesn't suck!). jQuery is very JavaScript-y and very functional in its programming paradigm.

    ReplyDelete
  14. Ajax sucks, use real RIA technology like Flex or Silverlight

    ReplyDelete
  15. Come on Steve, you know JavaScript SUCKS. Writing it by writing GWT Java code and having it generate JS is a joke too. In the end it's all the same: crappy, has-been, browser dependent AJAX/DHTML garbage.

    I'm not saying this with bias towards Flex or Silverlight (true RIA technologies), as I have little towards either. I say this because I am convinced that the mistake of Ajax will turn out to be yet another very costly mistake as the browser wars continue to heat up once again, standards change, and GWT/Dojo/zk/etc AJAX tools will need to be updated on a constant basis (not to mention all the so-called applications built with them!).

    Will the large amount of resources required to maintain these bulky and costly "JavaScript frameworks" (compared to fewer resources required to build VM-based RIA tech) continue to be committed in the years to come as browser technology evolves? Are you willing to bet your job that your JavaScript framework will not be dropped due to the high cost of it's maintenance?

    Anyway, AJAX is not RIA technology, period.

    ReplyDelete
  16. Let's try to make a difference between saying JavaScript sucks and saying Java developers dislike it. I think Google developed GWT because Java developers dislike JavaScript, not because it sucks.

    And why the dislike it? See post on it: http://larselrund.wordpress.com/2010/10/31/why-javascript-scares-the-hell-out-of-the-java-developers/

    ReplyDelete
  17. Comming from a desktop developper background, pretty muc everyting mentionned in the comments sucks except Flash/Flex/Silverlight. Loosy typing, browser incompatibility, poorly made buggy scripts, framework source code ridden with jokes and ascii art (jQuery) etc... the web was built as an anarchic platform by script kiddy.

    ReplyDelete