이 블로그 검색

2011년 8월 10일 수요일

gwt vs jquery


I agree with Russ Cam that it depends on what your team is familiar with. When I am doing work for my personal business apps, I much prefer GWT. I find javascript, even with jquery, to have annoying object oriented syntax. If you have an app with 10,000 lines of UI code, jquery strikes me as something that would lead to a mess of hard to maintain code with poor reuse.
Does anyone know of a large scale project done in jquery?
I think if you are trying to squeeze every last byte out of the resulting filesize, don't use any library and write the javascript from scratch (ie: google homepage fade effect).
Something to think about regarding javascript/jquery versus gwt. If you use common object oriented principles and design patterns, you will likely get better performing code with gwt. Why?
Let's take the example of polymorphism. If you write an app that uses heavy polymorphism in javascript, you will get the benefit of maintanability and code reuse this provides. However, your code will also get the performance hit of using polymorphism.
Now, if you used gwt, you will also get the benefit of maintanability and code reuse this provides, BUT the gwt compiler will optimize away the polymorphism into concrete class usage, hence increasing performance.





I would go with JQuery.
I had the chance of maintaining a GWT project that eventually forced me to re-write it twice. First as a refactored GWT. Second as a JQuery.
I haven't touched Javascript seriously for a very long time. Last time was 2002? I'm a Java developer so my first impression with GWT is awesome. But that was just the impression.
Problems I found with GWT:
  1. It forces you to follow it's client/server structure. At the end all I want is AJAX and those good widgets. GWT's widget by itself doesn't seem that really great looking. Aesthetically, I'd preferred Adobe Flex! But to keep the comparison closer, JQuery's UI look better than GWT's. In addition you have that wonderful Theme Roller support from JQuery.
  2. I've tried DWR. It's great. It's far easier to enable AJAX in your Java using DWR than GWT.
  3. If you're using GWT, eventually you will be forced to learn JavaScript. Arjen of SpringSource once said about XML and SOAP (though not the exact quote): "How can you develop WebServices and not knowing XML? SOAP is XML. You can't avoid it". Same thing with GWT. It's still Javascript at the end.
  4. Realistically Javascript isn't that hard to learn vs Java. More people know Javascript than Java. Even web designers know them. You're a programmer, and you're scared of Javascript?
  5. Back to the project I rewrote. When I rewrote our GWT application it took me almost two months to rewrite it. With JQuery it took me two weeks for someone who is rusty with JavaScript.
  6. With JQuery you don't really write that hardcorde JavaScript. That's why you have JQuery in the first place. Maintaining code with GWT is horrible. You wanna see the latest changes you did in the code...go compile..wait for GWT...5 minutes...rinse...and repeat and hope it doesn't throw an error. If it does, you'll be recompiling again, wait for 5 minutes. Rinse and repeat. With JQuery change a line, refresh your browser. Done.
I know I'm not being precise here, but I'm just sharing my experience :) The moral is don't be scared with Javascript. Google use Javascript anyway




I agree with Russ Cam that it depends on what your team is familiar with. When I am doing work for my personal business apps, I much prefer GWT. I find javascript, even with jquery, to have annoying object oriented syntax. If you have an app with 10,000 lines of UI code, jquery strikes me as something that would lead to a mess of hard to maintain code with poor reuse.
Does anyone know of a large scale project done in jquery?
I think if you are trying to squeeze every last byte out of the resulting filesize, don't use any library and write the javascript from scratch (ie: google homepage fade effect).
Something to think about regarding javascript/jquery versus gwt. If you use common object oriented principles and design patterns, you will likely get better performing code with gwt. Why?
Let's take the example of polymorphism. If you write an app that uses heavy polymorphism in javascript, you will get the benefit of maintanability and code reuse this provides. However, your code will also get the performance hit of using polymorphism.
Now, if you used gwt, you will also get the benefit of maintanability and code reuse this provides, BUT the gwt compiler will optimize away the polymorphism into concrete class usage, hence increasing performance.

댓글 없음:

댓글 쓰기