Sponsored By

Feature: 'Book Excerpt: Game Coding Complete - Smart Design Practices'

In today's main Gamasutra feature, an extract from Paraglyph Press' new book Game Coding Complete, author and game coding veteran Mike McShaffry argues that game p...

Simon Carless, Blogger

June 29, 2005

2 Min Read
Game Developer logo in a gray background | Game Developer

In today's main Gamasutra feature, an extract from Paraglyph Press' new book Game Coding Complete, author and game coding veteran Mike McShaffry argues that game professionals can make their work much more efficient by improving how they design their software, going on to give practical examples. In the extract, McShaffry points out: "Isaac Asimov's Foundation series invented an interesting discipline called psycho-history, a social science that could predict societal trends and macro events with great certainty. Each historian in the story was required to contribute new formulas and extend the science. As a programmer, your job is similar. Every new module or class that you create gives you the opportunity to extend the abilities and usefulness of the code base. But to do this effectively, you must learn how to think ahead and design code with the goal of keeping it in use for many projects and many years. Designing good code in an object-oriented language can be more difficult than in a procedural language like C or PASCAL. Why? The power and flexibility of an object-oriented language like C++, for example, allows you to create extremely complicated systems that look quite simple. This is both good and bad. In other words, it's easy to get yourself into trouble without realizing it. A good example of this is the C++ constructor. Some programmers create code in a constructor that can fail. Maybe they tried to read data from an initialization file and the file doesn't exist. A failed constructor doesn't return any kind of error code, so the badly constructed object still exists and might get used. Another example is the misuse of virtual functions. A naïve programmer might make every method in a class virtual, thinking that future expandability for everything is good. Well, he'd be wrong. A well thought through design is more important than blind application of object-oriented programming constructs." You can now read the full Gamasutra feature on the subject (no registration required, please feel free to link to the article from external websites).

Read more about:

2005

About the Author

Simon Carless

Blogger

Simon Carless is the founder of the GameDiscoverCo agency and creator of the popular GameDiscoverCo game discoverability newsletter. He consults with a number of PC/console publishers and developers, and was previously most known for his role helping to shape the Independent Games Festival and Game Developers Conference for many years.

He is also an investor and advisor to UK indie game publisher No More Robots (Descenders, Hypnospace Outlaw), a previous publisher and editor-in-chief at both Gamasutra and Game Developer magazine, and sits on the board of the Video Game History Foundation.

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like