- Game Development Patterns and Best Practices
- John P. Doran Matt Casanova
- 289字
- 2021-07-02 23:43:48
Why a monolithic game object is a bad design
When you break it down to the simplest terms, programming is about solving problems with code. Someone has an idea for a game or an app, and the problem that needs to be solved is how to describe that idea logically and correctly to the computer. Day to day, these problems usually come in the form of integrating code you wrote today with code written earlier by you or another programmer. When solving these problems, there is a constant struggle between doing things the easy way or doing them the right way.
The easy way to solve a problem means solving the immediate problem in the fastest way possible. Examples of this might be hardcoding a number or string literal instead of using a named constant, copying code instead of writing a function or refactoring code into a base class, or just writing code without thinking about how it can impact the rest of the code base.
On the other hand, solving a problem the right way means thinking about how the new code will interact with the old code. It also means thinking about how the new code will interact with future code if the design changes. The right way doesn't mean that there is only one correct solution to the problem. There are often many possible ways to reach the same result. The creativity involved in programming is one of the reasons programming is so much fun.
Veteran programmers know that in the long run, the easy way often turns out to be more difficult. This is often because a quick fix solves an immediate problem but doesn't consider the changes that will occur as the project evolves.
- Visual Basic .NET程序設(shè)計(jì)(第3版)
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- JavaScript:Functional Programming for JavaScript Developers
- 羅克韋爾ControlLogix系統(tǒng)應(yīng)用技術(shù)
- C語(yǔ)言程序設(shè)計(jì)
- Learning Informatica PowerCenter 10.x(Second Edition)
- Linux環(huán)境編程:從應(yīng)用到內(nèi)核
- 單片機(jī)應(yīng)用技術(shù)
- Redis Essentials
- Java:High-Performance Apps with Java 9
- Python深度學(xué)習(xí):基于TensorFlow
- Mastering Android Development with Kotlin
- PySide 6/PyQt 6快速開(kāi)發(fā)與實(shí)戰(zhàn)
- Essential C++(中文版)
- Vue.js應(yīng)用測(cè)試