Skip to content

Refactoring - Remove Control Flag #5

@stikrobinson

Description

@stikrobinson

The playGuess method of the Hangman.java class has a control variable that is used to condition the exit of a loop or make subsequent decisions. Although it is possible to simplify the program flow by using other constructs such as a direct return, or a break. The advantages of this refactoring are: improving readability by eliminating unnecessary variables, making the code clearer and less error prone.
image

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