Hacker News new | ask | show | jobs
by sirclueless 5223 days ago
And everything to do with the fact that it was written by C++ programmers.
1 comments

Doom3 was written in C++ by John Carmack.

https://github.com/mtrencseni/doom3

John Carmack is a C programmer coding in C++ which fits pretty well with sirclueless's point about that it is the C++ programmers that are the problem. All his games before Doom 3 were implemented in C.
I imagine he had some help with that. And a lot of what he's been talking about recently is about tools for keeping code quality high; he obviously places a premium on good code over working code.
My point is, you can write good, readable, performance, large-scale codebases in C++. Note that Carmack wrote his previous engines such as Quake3 in C, and switched to C++ at some point. I think one of the reasons was that as their programming team size grew from 5 to 50 at id, C++ started making more sense for them. If you look at a book like "Large Scale C++ Software Design", the subset of C++ it uses is about the subset that I think makes sense in practice, roughly C with classes. To be fair, I think that was the language subset that actually worked in compilers at that time.

Irrespective, I don't doubt that C is a valid and perhaps better choice for writing an OS kernel. There's less abstraction in C, and you have to worry less about making sure you don't use a language feature of C++ that has a hidden cost.

https://github.com/mtrencseni/quake3

The book I mentioned, "Large Scale C++ Software Design":

http://www.amazon.com/Large-Scale-Software-Design-John-Lakos...