03-14-07 - 1

In some circles in game development I've become the "C++ advocate guy". That's really weird to me, because in my past life pre-games I was the anti-C++ guy. Way back in the day at Contemporary Tech and Data General and then Eclipse I was the guy who really liked low level C, getting in the nitty gritty, and C++ was scary and evil. Over the years I evolved into the "C++ is okay, but only in very limited use" then I became the "C++ is cool, but templates and multiple inheritance are evil" , and now I'm the "C++ is all good" guy. In hindsight I see that at each point my view was not based on logic, but just on what I was familiar with. When I was totally anti C++ it was really because I didn't know C++ at all, and I didn't want to go from being a bad-ass C coder to being a crappy C++ coder. Then as I learned it more, my aversion was based on working with bad C++ coders and working in bad C++ code bases where complex features had been used badly and turned into a mess. I saw that ugly mess and the problems with them and didn't really understand the systems and just wrote those features off as evil without really understanding them. I still think that many of the C++ features are scary and need to be controlled carefully in the development environment (it's sort of like the D&D wizard spell Gate - you can invoke great power, but if you're not Protected from Evil that power can turn against you). Compared to a full C++ embracer (a beast which does not exist in game development, but there are many of them out in the large business applications world) I'm still a low-levelist and scaredy-cat.

Unfortunately, some of the things that make the overheads of C++ almost free on a modern processor (large caches, out of order execution, complex load-store units) have already disappeared from current consoles and may be disappearing on future PC's. That blows.

Anyway, this thought process makes me doubt the common assertions like "Perl code is an unmaintainable mess". Yeah, maybe, but I believe that largely because the Perl code I've seen is an unmaintanable mess. Maybe I've just seen bad perl code? I've certainly never tried to write a large clean app in Perl, so maybe you totally could and it would be fine if you had a strong style guide, etc. The same thing goes for contentions like "X language is too slow" - is it really, or is it just a matter of newbs not knowing how to write fast code in that language? (I guess the best way to compare language speed is to look at those contents where people write speedy algs in different langs).

No comments:

old rants