Trending
Opinion: How will Project 2025 impact game developers?
The Heritage Foundation's manifesto for the possible next administration could do great harm to many, including large portions of the game development community.
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...
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:
2005You May Also Like