Dojo, DWR, freebies and me at the Detroit JUG tomorrow

The Detroit Java Users Group is meeting out at ePrize tomorrow for a talk about DWR and Dojo. I’ve been wanting to learn more about DWR, so this is a good chance. I’ll be heading out there to the meeting and SitePen has provided me with some Dojo goodies to give away (t-shirts, books and stickers).

I hope to see you there!

Why Java remains the most popular language on the JVM

My latest blog post is up on the SitePen blog:

Mark Ramm-Christensen posed some questions about using the JVM as a platform for dynamic languages. Many people do, in fact, use dynamic languages on the JVM (Groovy, Beanshell, Rhino, Jython, JRuby are some big ones… and don’t forget Scala, Nice and other “non-dynamic” languages that target the JVM). But Java the platform has not gotten widespread or serious attention until recently (witness the recent resurgence of Jython, the rise of JRuby and the coming of the Da Vinci Machine).
[From Why Java remains the most popular language on the JVM]

Answering the question “Why Java remains the most popular language on the JVM” gives clues as to what might be the next most popular language on that platform.

DWR joins the Dojo Foundation – Joe Walker joins SitePen

Intriguingly, Ajaxian seems to have the news first: Ajaxian » DWR joins the Dojo Foundation – Joe Walker joins SitePen. I haven’t used Java in 3 years, so I haven’t had a chance to use DWR, but it looks like a nicely designed API for doing Ajax and Comet in Java apps. Having Joe Walker join up at SitePen is great news indeed, and DWR is quite an addition to the Dojo Foundation.

Update: Ahh, that’s more like it. The word is officially out: the SitePen press release, the SitePen blog (which has considerably more w00ts than the press release) and Joe Walker himself announcing it.

Matisse – the new NetBeans GUI Builder

Matisse – the new NetBeans GUI Builder looks quite nice from the demo screencast. Though it’s been several months since I was looking at the Eclipse GUI building tools, this is far ahead of those tools in ease-of-use. Very nice work!

I did see one comment that compared this with Apple’s Interface Builder. Something I didn’t see in Matisse (maybe it’s there, but it wasn’t in the screencast), is the data binding aspect of IB. Being able to draw a nice looking, internationalizable, resizable, cross-platform GUI is quite a trick… but, being able to also wire it up to your objects without a whole bunch of controller code is the bit of beauty you get from IB.

Perhaps the data binding of JDNC will get hooked up with a future version of the Netbeans GUI builder.

Are types worth *this*?

Tim Bray, who has spoken out previously on the goodness of “scripting languages”, laments the pain caused by the combination of Java Generics, Arrays, and Comparables. Given Java’s strongly-typed nature, I think generics are a good thing, because they extend the typing protection. (If you’re going to buy in to static typing, you might as well go all the way!) If you are trying to compare arrays of objects in Java, you’d do well to look at Tim’s post and save yourself some time.

On seeing those snippets of code, I’m just happy to be working in a dynamically-typed language with friendly syntax. For folks who do like strongly-typed languages and want to be able to continue working with Java classes, take a look at Nice to see how things *could* work.

Beware of Java string memory allocation

Charles Miller and other Atlassian folks were digging into a memory issue and found out that memory allocation and garbage collection for Strings and StringBuffers may not be what you’re expecting. The main thrust of it is that there are some optimizations to speed the common cases that can result in considerable memory waste if you’re not aware of the implementation. (For example, if you have a StringBuffer with a 32K capacity and do a toString on it, that new String will take up 32K of memory even if you only had 1 byte in the StringBuffer.)

To me, that actually sounds like a bug. It’s probably worth a couple microseconds (or less) to see if the data is significantly smaller than the allocated space and then do a copy if that’s the case.

JPackage on Fedora Core 3

I wanted to install Tomcat and ant on my new Fedora Core 3 box. Installing Tomcat failed, because I was missing jta. Since jta is a non-free package, you need to jump through some hoops.

So, I jumped the hoops and then jta was complaining about missing java-devel. I had actually installed J2SDK from Sun’s RPMs. I decided to go the full-blown JPackage route and install the J2SDK their way. Fine and dandy. Except, the RPMs built via the JPackage build process wouldn’t install! They complained about not having the Java .so files (but I thought that’s what I was installing!). Michael Peters to the rescue: Java in Fedora Core 3 mentions this problem, and he provided a SPEC file to fix this.

Sadly, I was still missing a library that java wanted. Michael Peters’ page also listed the magic incantation to get Sun’s RPM working with JPackage: yum install java-1.4.2-sun-compat. I missed that on the JPackage site.

Choosing python, what do you want on Javablogs?

For the past year and a half, I’ve been posting links and occasional articles on Java-related topics, averaging more than 60 reads from Javablogs. You may have been noticing an increasing number of links to Python related topics over the past couple of months. That’s because I’ve switched my development to Python.

I will still be posting links and articles (more articles than before, even) on general programming related topics. I will also be posting info about running a software business. So, here are the choices of what I can feed Javablogs:

  1. Software development and Java-related articles
  2. Business of software articles
  3. Python-related articles

Some people might actually appreciate seeing some of what’s going on in the Python universe. My guess is that most people, though, would opt for #1 and #2 above. What do you think? Leave a comment or send email if you care.