About a year ago – after almost a decade of coding in C and C++ – I took a leap on the “other side”. Our team was lacking a server side Java developer so I took a four day crash course on Spring and started writing code in Java.
Nothing has been the same after that.
First of all I recommend the course for everybody in need for that kind of training. It was arranged by SpringSource and went by the name Core Spring. The description of the course says:
In this four-day bootcamp you learn how to use the Spring Framework to create well-designed, testable business applications in an agile manner.
And at least I learned what they promised. The first week after the course I was already producing value.
I was really really amazed about the productivity increase in compared to coding in C++ using Microsoft’s Visual Studio 2005 which I had done earlier. The amount of available libraries and the ease of use of those (with e.g. Apache Maven) was something I had never seen in the C++ world. Sure there are a lot of libraries available for C++ as well, but they’re mostly commercial and/or closed source and taking them in use is really not that straightforward.
And the development environments. Wow. During the Spring course we did the exercises using Eclipse which is Open Source btw. And I had wasted so many years fighting with Visual Studio, doing refactoring manually or by using search and replace. I had never done any unit testing or real TDD, I had been writing all my constructors and getters/setters by hand. Now I was using this free tool which did all this manual work automatically and intelligently! No more using code snippets (in combination with search&replace) for writing the required boilerplate code thanks to intelligent editor and Spring. Later on I changed Eclipse to a commercial tool called IntelliJ IDEA – that’s probably the best programming editor I’ve ever used.
And don’t get me even started with Hibernate…
Anyway, last week I had to return back to the native world of Visual Studio 2005 and C++. This time, however, I could use a real application framework: Qt. And it’s actually even more than that Qt is a cross-platform application and UI framework. It is the first C++ application framework which was easy to take in use. Get a license, download, install, use. At least the three first parts were easy, it took me a while to get used in the concepts used in Qt. All these signals and slots look a bit confusing in the beginning. Also the (unit) testing framework (QtTest) included in Qt was not the easiest one to learn. Good thing is that the documentation for getting started is really good and easily available. Bad thing about the documentation is that since all classes are ‘Q’something, help index usability suffers a bit. Anyway, I soon found out that Qt is a lot more than a cross-platform UI framework, which was pretty much why we started using it in the first place. It has a lot of stuff included - all ready to use.
Like in Java world.
Almost.
I think Qt is merely a good start – it’s a big step towards the easy reuse of components in the C++ world. And I think Nokia now owning Qt is a really good thing. Qt is available as commercial edition as well as (L)GPL editions – on multiple platforms. And it is also possible to contribute to developing the frameworks (see http://qt.gitorious.org/). Really good.
If only we got a better programming editors for C++ as well… The best environment (for Windows) seems to be Microsoft Visual Studio 2008 enhanced with Whole Tomato’s Visual Assist X add-in.
Unfortunately the .NET world is still unknown to me… I’ve heard some really good things about that, specially the latest versions of the framework seem to be fairly decent development environment. A colleague of mine once even said that “Windows Vista with the .NET Framework 3.0 is the world’s best development environment.” Ironically, at that time Vista was just about to become more popular so we couldn’t get that as operating system for our work computers. In fact, we still can’t get Vista, we have to use Windows XP (or Linux – which IMHO is a lot better choice) – and 32-bit version only…
The thing which makes me wonder the most is that C++ has been around a looong time – since 80’s. And it’s precessor C a fair amount longer. Java is a young language in compared to the old-timers and yet it’s so much better supported and promoted.
As I will be working quite a lot with Visual Studio (version 2005 at the moment), C++ and Qt in the future as well I’d love if someone proved me wrong in what comes to the available development environments. Pretty please.
Oh, one more thing… Why can’t I do this:
/*1:*/ class ThisSucks {
/*2:*/ public:
/*3:*/ ThisSucks() {};
/*4:*/ ~ThisSucks() {};
/*5:*/ static const int MY_STATIC_CONSTANT_INT = 1;
/*6:*/ static const wstring MY_STATIC_CONSTANT_STRING = L"Not allowed";
/*7:*/ static const wstring MY_OTHER_STATIC_CONSTANT_STRING;
/*8:*/ };
/*9:*/ const wstring ThisSucks::MY_OTHER_STATIC_CONSTANT_STRING = L"This is allowed";
The above example doesn’t compile – line 6 gives error C2864 (note how bad the documentation of error C2864 is). On the other hand, there’s nothing wrong with lines 5, 7 or 9. I just don’t get it.