Quake3World.com Forums
     Programming Discussion
        An analysis of the Doom3 source code.


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: An analysis of the Doom3 source code.

Messatsu Ko Jy-ouu
Messatsu Ko Jy-ouu
Joined: 24 Nov 2000
Posts: 44139
PostPosted: 01-14-2013 11:37 AM           Profile   Send private message  E-mail  Edit post Reply with quote





Top
                 

Glayven?
Glayven?
Joined: 23 Jan 2005
Posts: 13025
PostPosted: 01-14-2013 01:23 PM           Profile Send private message  E-mail  Edit post Reply with quote


Image




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 01-16-2013 01:06 AM           Profile   Send private message  E-mail  Edit post Reply with quote


John Carmack actually responded to it on Kotaku:
Quote:
Thanks!

A few comments:

In some ways, I still think the Quake 3 code is cleaner, as a final evolution of my C style, rather than the first iteration of my C++ style, but it may be more of a factor of the smaller total line count, or the fact that I haven’t really looked at it in a decade. I do think "good C++" is better than "good C" from a readability standpoint, all other things being equal.

I sort of meandered into C++ with Doom 3 – I was an experienced C programmer with OOP background from NeXT’s Objective-C, so I just started writing C++ without any proper study of usage and idiom. In retrospect, I very much wish I had read Effective C++ and some other material. A couple of the other programmers had prior C++ experience, but they mostly followed the stylistic choices I set.

I mistrusted templates for many years, and still use them with restraint, but I eventually decided I liked strong typing more than I disliked weird code in headers. The debate on STL is still ongoing here at Id, and gets a little spirited. Back when Doom 3 was started, using STL was almost certainly not a good call, but reasonable arguments can be made for it today, even in games.

I am a full const nazi nowadays, and I chide any programmer that doesn’t const every variable and parameter that can be.

The major evolution that is still going on for me is towards a more functional programming style, which involves unlearning a lot of old habits, and backing away from some OOP directions.

http://www.altdevblogaday.com/2012/04/2 ... ming-in-c/




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.