Skip to content

Use functions #5

@rod-laycock

Description

@rod-laycock

Functions are your friend

If there is code which does something - functionise it

I can spot 2 places in this to create a function

  1. int GenerateRandomNumber()
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions