Functions are your friend
If there is code which does something - functionise it
I can spot 2 places in this to create a function
- int GenerateRandomNumber()
- string ChooseEnemy(int diceRoll)
As your application gets larger, debugging large functions is a nightmare - debugging a small function which does 1 thing is easy.
Functions are your friend
If there is code which does something - functionise it
I can spot 2 places in this to create a function
As your application gets larger, debugging large functions is a nightmare - debugging a small function which does 1 thing is easy.