该过程不仅速度慢,而且代码也难于理解和维护。
Not only is that process slow, but the code is also difficult to understand and maintain.
使用固定的游戏速度和最大的FPS是一个容易实现而且代码简洁的解决方案。
Using a constant game speed with a maximum FPS is a solution that is easy to implement and keeps the game code simple.
劣质的API不但会带来更多的编码,而且代码结构也会更加复杂,潜藏bug的地方也就越多。
Poor APIs often require not only extra code, but also more complex code that provides more places where bugs can hide.
Things generally break and this is also not very readable.
一切都改变了,而且这样写出的代码可读性也不高。
Remember last time, I said that there's different kinds of complexity in our code, and I suggested for simple branching programs, the amount of time it takes to run that program is, in essence, bounded by the number of instructions, because you only execute each instruction at most once.
但是这里有个很重要的点,记得上节课,我提过在我们的代码中,有不同种类的复杂度,而且我还说了对于简单的分支程序,运行这种程序需要的总体时间,大体上,是和指令的数目相关的,因为每个指令只会被执行最多一次。
应用推荐