Refactoring and Refining Verse Code
This final tutorial step shows you how to improve your code while teaching some important Verse concepts as you go.
Improve Your Verse Code
This page guides you step by step through the code changes, but if you want to check your work, review the Complete Code section for the final result.
Refactoring is a process in which you restructure existing code to improve the design or implementation without changing its behavior. The following are the most common goals when refactoring your code:
- Improving readability with better variable naming, better spacing or overall code structure.
- Improving performance with simpler or more efficient implementation of behavior.
- Reducing repetition and code bloat (large, unnecessary or overly complex code) by condensing similar functions into one or gathering multiple variables of similar type and purpose into containers like arrays.
Refactoring by following these goals should help you write code that is maintainable, easy to read and revisit, and extensible, easy to extend the capabilities of for future enhancements to the behavior. Making your games really level up!
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.