Alice's Code Review Nightmares
This is a page about the code reviews that make Alice go to therapy.
Here is the code that caused the most recent nightmare:
public class Nightmare {
private int terror = 1000;
private string nightmare = "I am lost in a sea of code";
private bool isAwake = false;
public void wakeUp() {
isAwake = true;
System.out.println("I am awake!");
}
public void sleep() {
isAwake = false;
System.out.println("I am asleep...");
}
public void addTerror(int amount) {
terror += amount;
System.out.println("Terror level increased by " + amount);
}
public void subtractTerror(int amount) {
if (terror - amount < 0) {
terror = 0;
} else {
terror -= amount;
}
System.out.println("Terror level decreased by " + amount);
}
public void setNightmare(string nightmare) {
this.nightmare = nightmare;
}
}
This code is so bad, it should be banned.
Fix the Nightmare