Skip to content

Functions, Commands, etc. should be generalized #60

@Starlight220

Description

@Starlight220

There are many functions, commands, etc. in the code that do almost the same thing - with one change.
For example, instead of two functions : turnLightOn() and turnLightOff(), there should be one function : setLight(boolean on). This problem starts on the class function level and propagates to the Command level.
Generalizing your code will reduce clutter in your classes, packages, etc, and most important -> if you need to change some action - you will need to only change one place, reducing inconsistency bugs.

tl;dr/in two words -> USE PARAMETERS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions