A few weeks ago, Google opened up development of their Google Web Toolkit and released the whole system under the Apache license. Now they've taken the next logical step, by accepting their first outside contributor to the project: Sandy McArthur. I caught up with Sandy after the announcement to ask him about the pros and cons of GWT, why a web developer should consider it, and how they can get started.
[ZDNet] What drew you to GWT in the first place?
[Sandy] Java is my favorite language because I prefer it's structure and rigidness. It protects me from myself and I believe I write better code the first time when I write in Java than if I'm using a loosely typed language or less defensive ones such as C/C++. Also, anyone who has used IntelliJ IDEA (and to a lesser extent Eclipse & NetBeans) will be able to tell you that the claimed weaknesses of a strict, strongly-typed language are actually strengths because of how the tools can assist you.
A significant portion of my programming at work is web related and pressure to provide AJAX-esque features in webapps eventually got me to make time to prototype some crude user interfaces with GWT. Previously, I'd try a different AJAX toolkit about every month looking for one that fit me. I only wish I'd given GWT a try a few months earlier.
[ZDNet] So it was love at first sight?
But then after using GWT for a while I realized GWT is not strictly Java and that GWT works well. This is a bit confusing since GWT feels at lot like Java and is sold as a Java platform so people can better wrap their brains around it. That isn't a negative for GWT, its similarity to Java is what lets you use many of the programmer's existing Java skills and allows them to use many of the powerful tools Java already has.
[ZDNet] What do you use it for now?
[Sandy] Mostly work related projects, and since Google open sourced the compiler I've enjoyed learning about it and trying to improve it.
[ZDNet] Fill in the blank: GWT is the greatest thing since ____?
[Sandy] ... since XmlHttpRequest became available in all common browsers.
There are many things better than GWT. (Sex, drugs, and rock and roll to name a few. :-) ) It's just DHTML and XmlHttpRequest are the foundation of AJAX and GWT is the next best thing in that context. [continued on page 2...]
[ZDNet] You put a lot of time into GWT. Why did you want to become a contributor?
[Sandy] I enjoy programming. Like many people enjoy solving puzzles, I get a satisfaction from solving programming puzzles. If figure if I'm going to spend a chunk of my spare time programming, it may as well be in places that provide the most benefit (to me at least). The programming I do at work isn't all fun, but if I can sometimes incorporate the code I've written for pleasure at work too then it makes the more mundane code less tedious. Other times I'm just unfamiliar with something and want an excuse to figure it out.
I would like Google to accept my contributions for all the riches, fame and glory that will come with getting a patch accepted. :-) Actually, I'd be happy even if they reject my patches so long as they give some reason why so I can learn from it. If I'm going to hack on something and think I've come up with an improvement I take the steps to contribute it back to the original project. I'm not sure how many projects have accepted patches from me but it's probably in the 10 to 15 range.
[ZDNet] Was becoming a contributor a complex process? Did you have to assign joint copyright to Google?
[Sandy] Basically just sent in a Contributor License Agreement (CLA). As far as I can tell Google has adopted the exact same process and language as the Apache Foundation uses. Since I'm also a member of Apache's Jakarta Project I've been through this process before and figured out all the hard parts already.
The hardest part for me was figuring out what rights your employer has over code you create even when you aren't on their clock. Every few years you read about a nasty lawsuit between an employer and employee over who has rights to an application that the employee claims was written in their spare time. My employer has been kind enough to acknowledge that I contribute to various open source projects (some that are also work relevant) and I have it in writing that they make no claims on that work. If my employer was less permissive or wanted to pay me to work on open source projects I'd need a Corporate CLA.
I strongly suggest anyone who contributes to open source projects and is employed to work this out with their employer for their protection and the project's protection. If you are starting a new job, this is a question you should ask them during your interview.
[ZDNet] What's the purpose of a CLA? Did you have to assign joint copyright to Google?[Sandy] The CLAs basically put in writing that I understand I own or have the permission to contribute the code I am contributing and that I give Google the rights they need to distribute the code too. My understanding is that code I contribute is then copyrighted by Google but that isn't an exclusive copyright, meaning that I also have a copyright on that same code I wrote and am free to do whatever I want with it except revoke their right to use the contributed code. Details are available here.
[ZDNet] What's the next step for you? Writing a book? Maybe getting hired by Google to work on GWT?
[Sandy] I don't have a desire to write a book. I'm not sure I'd be a good author. I think I'd be a decent instructor but books don't have the real-time feedback that lets me constantly adjust like working directly with people does.
As for working for Google, I'm fortunate to be in a good place in my life right now. But if someone at Google thought we'd benefit each other I'd seriously consider it. (Who wouldn't? Fortune says it's the best place to work.) [continued on page 3...]
[ZDNet] What do you see as GWT's niche?
[Sandy] GWT is great for new Java webapp projects that need rich webapp functionality. It needs to own the page which is why I don't think it may be the best for for established projects.
(Update: Google says GWT works fine in existing projects; see their comments in the Talkback section. -Ed)
Late last fall I spent about an hour and a half showing a friend GWT. In that time I was able to show him everything from creating a project to recreating one of his more complex web interfaces he works on and connect it to a server with RPC. I was already somewhat familiar with GWT but I still think that is really amazing.
[ZDNet] How easy is it for a developer to get up to speed with GWT?
[Sandy] It depends. If you are a Java programmer than it isn't bad at all. There are parts where GWT is different than Java and if you have good tools they can assist you. Since GWT is young, the GWT specific tools aren't mature but the tool smiths out there are improving their products at an impressive pace. You also need to be able to write CSS else your webapps will be plain. Both of those issues are being addressed by tool smiths and Google.
I suggest that people who want to get started with GWT first try to run each of the examples in the hosted mode browser. That way you know GWT is installed and working correctly and that you know how to launch it. Then figure out where in the source the text for a button is, change it and click reload in the hosted mode browser. You don't have to recompile and relaunch the hosted mode browser, it detects changes in real time which speeds up that write code and test it cycle much like if you were using a dynamic language.
Then take a straightforward but non-trivial part of something they've written before and try to reimplement the user interface using GWT. If you don't have something pick one of the example projects and mimic it. This will help you learn your way around the GWT widget set and give you a clear target so you can focus on learning GWT's APIs.
[ZDNet] What does the full open sourcing of GWT mean for it in the future?
[Sandy] It helps people feel secure that using GWT isn't as risky as using a closed source technology and should help adoption some but not much because the "full open sourcing" of GWT didn't change it's quality or price. By being open source, then if Google disappears or loses interest in GWT then others can carry it on.
[ZDNet] Would you use a framework that was not open source? Why or why not?
[Sandy] Sure, I think you should use the best tool for the job and you or your team. Open source or close source isn't a direct factor for me. What open source has going for it is that it often has a low barrier of entry. I don't have to ask for a budget line to use something that is free and because of that I'll prefer the free tools or tools with free trials. Other times the non-free tools really are worth their price. The most important factors for me in a framework are that it works and that it is well documented.
While I'm somewhat passionate about Java, and now GWT, I don't think people should let passion affect their technical decisions. It's a hard thing to do but too many people don't even try to be unbiased. I know people who are passionate about open source products and people who are passionate about various commercial products. In both cases I think those people tend to make sub-optimal technical decisions about a third of the time. It'd be better for everyone if we could lower that percentage.
Sandy McArthur works for Computing and Networking Services: http://www.cns.ufl.edu/ at the University of Florida in Gainesville, Florida. He lives with his wife and dog and is eagerly awaiting their first born this summer. He splits his spare time between disconnecting in the outdoors and programming for pleasure. He currently contributes to Apache's Jakarta project and recently the Google Web Toolkit project.