Ask Me How Much I Hate XCode and C

December 11, 2007

In the mid-90's I spent 5 years working exclusively in C++ after years of C. I learned all the ins and out of STL, templates, overloading and the like. Now after 10 years of Java I've spent a little time working with C++ again - working on some game code for WWIIOnline, rewriting my sound code again to support Core Audio in Leopard (and eliminating OpenAL use).

Argh, C++ is so painful to me now, and XCode as an IDE is beyond lame compared to my beloved IntelliJ and even the recently learned Eclipse. Poke me in the eye with a C# stick, it would hurt less.

XCode is the latest generation from Apple, going back to the early days of MPW in the 80's, and then passing through the tools from NEXT. Some days I really feel that the folks at Apple have never worked with a real Java IDE. Other days I feel sorry for them having to carry the baggage of a generation of make files and command line tools around all day. I mean IntelliJ and Eclipse are constantly compiling the Java source while I am typing it in, making it easy for the IDE to spot errors, inconsistencies, provide tips and hints and refactorings on the fly. C++ (and even Objective-C) despite on paper being faster in execution, apparently cannot be compiled fast enough to provide the same level of feedback. With IntelliJ I rarely ever see a compiler error. With Eclipse I rarely even see the compiler at all.

So working in C++ and XCode is really painful for a Java guy like me. Yeah if I was working in Cocoa and Objective-C, it might be more pleasant, but that's not the option here. Even then, in XCode I miss all the help I get from the IDE's that I'm used to. I know people love vi and emacs and swear by command lines but I don't miss the command line these days anymore than I miss the IBM PC XT.

Of course C++ all by itself is a painful language anyway. Sure, I can create the most complicated meta-templated code I'll never understand 5 minutes later but how is that productive? I remember when I first started working on this it took me ages to remember all the requirements for storing objects in a map. Maybe my brain has been too comfortable in Java where putting an object in a HashMap is just that. Maybe the occasional overriding of hashCode() and equals() but nothing much to remember.

Don't get me thinking about memory management. In Java I don't. In C++ you always have to remember when to get rid of stuff. At least in the latest Objective-C they finally added automatic garbage collection. This is the 21st century after all. As Homer Simpson once sang in an episode where he becomes the garbage commissioner "let someone else do it".

I wrote a commercial C++ memory manager in the 90's so I'm well aware of what it takes, and even wrote the whole thing in heavily templated C++, but that was a century ago it seems. Today I'd rather work on the problem at hand instead of futzing with a language and tools that get in the way. Of course for some folks even Java gets in the way (and I understand that as well but it's not a choice for my job yet) but at least it's not C++.

When I read about the newer features being added to C++ I can only think of all the profits the Tylenol folks are going to get. Effective use of C++'s features requires a real dedication to understanding their strengths and weaknesses. It's not a language for occasional use. When I used it everyday it was painful but familiar; today having worked with Java I have a hard time keeping C++ features in my head.

The bottom line for me is I want the computer to do all the heavy lifting, and let me focus on the actual work to be done with as little annoyance and loss of focus as possible. No matter what language or tools you choose they better meet that requirement (for you) or try something else.

Or break out the pain killers.