Improving C++ Code Quality
Congratulations, you have completed eight chapters and have made the game playable! But do you notice something in the C++ code you wrote that makes you feel uncomfortable – for example, the duplicated variables and functions in the APlayerAvatar
and AEnemy
classes? This chapter will introduce two approaches (code refactoring and code refinement) that developers regularly use to improve their code quality.
Additionally, you will also learn how to output debug messages in Unreal and two ways (by calling the Cast
and IsA
functions) to find out an actor’s class type.
By the end of this chapter, you will have a valuable awareness of the importance of maintaining code quality in programming, as well as knowledge regarding code refactoring, code refining, as well as the iterative process. This understanding will empower you to write high-quality and professional code.
Topics covered in this chapter include the following:
- Refactoring...