Skip to content

Instantly share code, notes, and snippets.

@rubdottocom
Created April 29, 2019 09:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rubdottocom/6267547a37f555d09d7a0784f4e6d14b to your computer and use it in GitHub Desktop.
// Originally posted on: https://rubdotto.com/clean-code-desinformaci%C3%B3n/
findDragonBall()
findDragonBalls()
findDragonBells()
findDragonWithBalls()
findDragonWithBalletSlippers()
// Originally posted on: https://rubdotto.com/clean-code-desinformaci%C3%B3n/
public class dummy {
int radarMode = 0; // 0 find Dragon Balls, 1 find Dragon
ArrayList<DragonBall> dragonBalls = new ArrayList<DragonBall>();
Shenron dragon = null;
private void onClick(int numberOfClickDone) {
if (numberOfClickDone == 1) {
if (radarMode == 0) {
dragonBalls = findDragonBall();
} else {
dragonBalls = findDragonBells();
}
} else if (numberOfClickDone == 2) {
if (radarMode == 0) {
dragon = findDragonWithBells();
} else {
dragon = findDragonWithBalletSlippers();
}
} else if (numberOfClickDone > 2) {
if (radarMode == 0)
radarMode = 1;
else
radarMode = 0;
}
}
}
// Originally posted on: https://rubdotto.com/clean-code-desinformaci%C3%B3n/
findDragonBall() -> findSingleDragonBall()
findDragonBalls() -> findAllDragonBalls()
findDragonBells() -> findDragonJingleBells()
findDragonWithBalls() -> findDragonAndDragonBalls()
findDragonWithBalletSlippers() -> findDragonPracticingBallet()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment