How much do you use C++ in your games ???

Started by
30 comments, last by Mescalito 21 years, 1 month ago
quote:Original post by marijnh
Can anyone recommend some source code that is an example of good c++ coding style?

At the risk of being accused of egotism, here are the source files to my Win32 Window Wrapper article (fairly small, focused mini-project/component; uses STL; good [IMO] and consistent coding style... can''t remember how well commented it is ):
http://www.uncg.edu/~obsonaiy/src/window.h
http://www.uncg.edu/~obsonaiy/src/window.cpp
http://www.uncg.edu/~obsonaiy/src/rendercontext.h

There''s also OGRE, which is very well designed and has a solid set of code conventions.

The other examples that readily spring to mind are fairly large, and thus inappropriate.
Advertisement
This may seem like a silly reason to prefer a language over another, but I like the cool class-browser stuff in MS Visual C++, and I''m sure that the other IDEs have something similar. This is especially helpful when working with a team. Your team mates may have cranked out some cool classes and member functions that you can re-use. In some cases I might have wasted a lot of time if I wasn''t able to spot their implementations all ready for use. It''s great to see the member functions listed nicely, where if you''re trying to use C structures you don''t get the associated functions listed so nice.

There are many other reasons I use C++ features rather than limit it to C, but the cool class browser stuff is some of the icing.

As for C++ templates, I think they are one of the best features, and I like that they are so ugly. They should stand out like an ugly sore thumb, effectively screaming "template here!". Ada 95''s version of templates blends in all too well with the rest of the syntax.

Value of good ideas: 10 cents per dozen.
Implementation of the good ideas: Priceless.
Proxima Rebellion - A 3D action sim with a hint of strategy
Value of good ideas: 10 cents per dozen.Implementation of the good ideas: Priceless.Machines, Anarchy and Destruction - A 3D action sim with a hint of strategy

This topic is closed to new replies.

Advertisement