Last active
April 28, 2019 06:26
-
-
Save rubdottocom/f5b89ae3f6e6ba260d10432d839a71cb to your computer and use it in GitHub Desktop.
Clean code examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Originally posted on: https://rubdotto.com/clean-code-nombre-de-variables/ | |
public boolean isSS(int r, int hc, int e) { | |
if (r != 3) { | |
return false; | |
} | |
if (hc != 0xFFFFFF00) { | |
return false; | |
} | |
if (e < 1000000) { | |
return false; | |
} | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Originally posted on: https://rubdotto.com/clean-code-nombre-de-variables/ | |
public boolean isSS(int race, int hairColor, int energy) { | |
if (race != 3) { | |
return false; | |
} | |
if (hairColor != 0xFFFFFF00) { | |
return false; | |
} | |
if (energy < 1000000) { | |
return false; | |
} | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Originally posted on: https://rubdotto.com/clean-code-nombre-de-variables/ | |
private static final HUMAN = 1; | |
private static final NAMEKIAN = 2; | |
private static final SAIYAN = 3; | |
private static final MINIMUM_ENERGY_REQUIRED = 1000000; | |
public boolean isSuperSaiyan(int race, int hairColor, int energy) { | |
if (race != SAIYAN) { | |
return false; | |
} | |
if (hairColor != Color.Yellow) { | |
return false; | |
} | |
if (energy < MINIMUM_ENERGY_REQUIRED) { | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment