Live data from Hacker News

Doom3 is the proof that “keep it simple” works

gamedev.net

21–30 of 111 posts

Re: Doom3 is the proof that “keep it simple” works

#21
post #17

These adverts pretending to be learning experiences, really bother me "CppDepend Tutorial" would be a better title

You must be the target audience then because I read a great article about Doom3 and have no clue what youre talking about. I also dont know what CppDepend is...

I think he refers to the tool the author was using to query the code.

Re: Doom3 is the proof that “keep it simple” works

#22

I wonder why they opted not to use references? It seems an odd choice to me, did id software give an explanation?

I thought exactly the same. Probably they needed to model an empty state and decided that a null pointer was the easier way to do it.

Re: Doom3 is the proof that “keep it simple” works

#24

As someone who wants to learn modern c++, what are some good resources/books to learn from ? I have python and java experience and I have been reading Accelerated C++ since a while now.

Not a definitive list, but these are good: The C++ Programming Language, 4th edition Bjarne Stroustrup The C++ Standard Library, 2nd Edition Nicolai M. Josuttis Effective C++, More Effective C++, Effective Modern C++ Scott Meyers http://en.cppreference.com

I would also add Effective STL too.

A Tour of C++ by B. Stroustrup is a good start point for a beginner too

Re: Doom3 is the proof that “keep it simple” works

#25

As someone who wants to learn modern c++, what are some good resources/books to learn from ? I have python and java experience and I have been reading Accelerated C++ since a while now.

Not a definitive list, but these are good: The C++ Programming Language, 4th edition Bjarne Stroustrup The C++ Standard Library, 2nd Edition Nicolai M. Josuttis Effective C++, More Effective C++, Effective Modern C++ Scott Meyers http://en.cppreference.com

Thanks, I'll read through those as well.

Re: Doom3 is the proof that “keep it simple” works

#27

As someone who wants to learn modern c++, what are some good resources/books to learn from ? I have python and java experience and I have been reading Accelerated C++ since a while now.

I resort continuously to this list, https://stackoverflow.com/questions/388242/the-definitive-c-...

Re: Doom3 is the proof that “keep it simple” works

#28
post #4

Not to brag but https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.c... (from line 154 down) that seems like another point against using tabs.

You think that's bad: https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h... Scroll down and watch the readability disappear.

Does this fix it? https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h...

Re: Doom3 is the proof that “keep it simple” works

#29
post #18

This is back in the good old days when C++ didn't have all the crap, and everyone wanted to stay away from doing advanced stuff with STL and RTTI. Linus famously said that Linux is written in C if only to keep away the C++ developers. Having said that, I used to write tutorials using the old ways as well: http://flipcode.com/archives/Theory_Practice-Issue_06_Event_... Does anyone love the new C++, and if so, what are…

I do enjoy programming in C++11 style. What I like the most is that once you understand the quirks, you would see a lot of opportunities to improve performance but only when necessary (Like using moving semantics if you have to pass a big object through several function calls)

Also STL has improved a lot and I am very happy that I don't need to include a huge dependency such as Boost or POCO just to have a hash table for instance.

Re: Doom3 is the proof that “keep it simple” works

#30

I wonder why they opted not to use references? It seems an odd choice to me, did id software give an explanation?

The most common argument:

Pass by reference hides the implication of a side effect on the parameter. If you expect the function to manipulate the parameter, passing by pointer is clearer.

Pass by reference was also only added to efficiently support copy constructors and more importantly operator overloading, both of which are syntactic sugar that a C with Classes style would normally avoid.

Template programming also requires pass by reference but templates are sugar on sugar so not the core reason why pass by reference is needed.

Ps. Disclaimer: I haven't checked if the Doom3 code uses these features.

Post reply on HN