开发者

is GWT right for me?

开发者 https://www.devze.com 2022-12-19 22:03 出处:网络
I\'ve been a C++ programmer for 15 years... I\'ve done NO Java development... I HAVE built we开发者_运维问答bsites with HTML, CSS, Javascript and PHP...

I've been a C++ programmer for 15 years... I've done NO Java development... I HAVE built we开发者_运维问答bsites with HTML, CSS, Javascript and PHP...

Now, my question is this: Is the productivity gain I'll get from using something like GWT really worth the learning curve for me? I don't really have a strong desire to learn Java... I've never used Eclipse before... The whole environment feels pretty alien... Really, I just want to get some sites done.

Now, that said, if GWT really blows the old way of working away, then I probably do want to learn it... What do you think? Is it that much better than coding by hand (perhaps with something like jquery)?


It depends on the website you want to develop.

If the website is like anything you find when you type an URL and expect to land at some place in the Internet then no. There are a lot of Javascript/AJAX frameworks that help you to be productvie with PHP and the few interactions required on usual websites.

But if the website is more like a desktop client application, just with a GUI inside the browser then the answer is yes - it's usefull and productive enough to learn it. The purpose of GWT was to do development which does not feel like developing a web application anymore.

So it's just a different use case. The right or the wrong tool for your work.

But you should learn at least a little bit java anyway. And believe me many people don't love Eclipse but it is usefull for java development. You should also try Netbeans maybe this is does better match your preferences.


If you are a C++ programmer, Java is going to feel a hell of a lot more comfortable to you than Javascript (jQuery, whatever). There are a million books for "Java for C++ Programmers," I'd suggest reading one. Keep in mind that Java is very different from C++, but the syntax should feel pretty familiar.

There are tons of advantages to using GWT to write your Javascript. A major one is the incredible debug-ability: you can insert breakpoints in your Java code and when the browser reaches those, you can inspect variables as if you were programming in a real language. The toolkit will also optimize and minify your Javascript code, easy-to-use support for internationalization, extremely advanced cross browser compatibility with basically no effort on the part of the developer...the list is long.

Ultimately, though, GWT and pure HTML complement each other. The biggest problem with making a whole site in GWT is that you get basically no search-engine optimization since all the code is Javascript and web crawlers don't do Javascript. So create the "classic" parts of your site in HTML and throw in some neat Javascript things and save GWT for the "web application" part. My biggest problem with GWT is that it really likes to consume your entire application, but this can be avoided easily enough.

Oh, and I forgot my favorite: image bundling. Basically, it allows you to put a collection of images together in an interface (Java interface ~= C++ class with only pure virtual functions), GWT puts all those together into a single image for downloading purposes and the framework on the client deconstructs those images for presentation. This reduces the number of HTTP connections required by a ridiculous amount, which is an easy way to decrease load time.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号