Facebook Tweet


Qt is better than Java.

Apr 2014

Why do we keep using Java? It is full of security holes, slow (at least for many Swing-based GUIs), uses non-standard OS controls (like its file-browsing widget), requires updating every other week, and now Oracle bundles the Ask toolbar with updates!

Java bundling Ask Toolbar on Windows 7

What do we get for all this pain?

The promise is “Security. Write once, run anywhere.“.

We can just toss the promise of security. Java security has been broken for a long time, and it shows no sign of being fixed. The “write once, run anywhere” promise is not true either. We can write once and run anywhere… that has a Java Virtual Machine installed. You know that thing that Oracle updates every 2 weeks and attempts to bundle Ask toolbar? That’s the JVM.

So it needs JVM, but everybody has Java, right? Well, for about a month, I didn’t have Java (had to reinstall Windows). Yes, it was just a download away. Still, even if our end-user does have Java, they may have the wrong Java. Java is highly version-specific. Our app may run on a different version than what the end-user has installed. And don’t even get me started on the huge pain Java versioning causes when trying to get Eclipse/Netbeans configured correctly. My recommendation to upcoming Java developers is to capture your development environment in a virtual machine. That way, if you need to migrate your workstation, you just copy over your VM. I would do at least one git check in of the whole vmdk file. Trust me.

Perhaps we are willing to put up with this craziness because in the end, the JVM is free and runs pretty much everywhere. Yes, it has problems, but it is “good enough”. We simply don’t have time to write everything with Windows C# and then again in Apple Objective-C.

No we don’t time, but my fellow developers, we don’t need to. There actually is a very good alternative. It is called “Qt“. Instead of “write once, run everywhere”, their promise is “Write once, COMPILE everywhere.” We can write our app just one time, using C++, and then we just compile it to each platform. There is no “byte-code” nonsense. Everything is a binary running full speed. The Qt libraries translates our app so various widgets like the file browser looks much closer to OS-native.

Setting up the dev environment is very easy. Qt Creator is a very nice IDE. When we build our app, we can bundle the linked libraries so the end-user always have the exact version that your app was compiled to use. (Use dynamically linked. Qt is LPGL.)

Qt is not new. It has been around for 20 years. Well-loved apps like VLC Media Player, Google Earth, and Autodesk Maya all use Qt. Next time we are starting up a cross-platform app, before we launch Netbeans, give Qt Creator a chance. These days, the only time I use Eclipse is for Android development (the only reason I re-downloaded Java BTW).

There. I’ve said my piece. Next, if I need to get everybody to dump Flash for HTML5. I still do not have Flash installed since reinstalling Windows. I hope I never have to.


Dan Nagle is a SW Developer and the founder of NagleCode. His apps have been downloaded hundreds of thousands of times. Contact Dan to speak at your event.

More Posts

Jan 2018: Pay Down Calc v2.0 - A Resource For Consumers and Agents
Jul 2015: Unity Publishing Metrics
May 2015: JavaScript is not the answer to everything
Feb 2015: Abandoning Scripts for Static Pages
Apr 2014: Qt is better than Java.
Oct 2013: The government does not need to make a health website.
Sep 2013: Google Reader may by dying but RSS is not
Jun 2013: Stop writing batch scripts. Start writing AutoIt scripts.
Mar 2013: Goodbye XP Hello Linux Mint
Dec 2012: Your Goals Should be SMART
Apr 2011: Happy 40th Birthday FTP and Farewell
Aug 2010: Breaking the World Record Typing Numbers to Words

Copyright © NagleCode 2007 - 2019.