Skip to content

Instantly share code, notes, and snippets.

@hawkw
Last active December 16, 2015 18:28
Show Gist options
  • Save hawkw/5477530 to your computer and use it in GitHub Desktop.
Save hawkw/5477530 to your computer and use it in GitHub Desktop.
a classic example of Eclipse trying to make code more readable and actually making it uglier
// ... to this
while (!instructionCompileStack.empty()) {
if (getReqArgs(instructionCompileStack.peek()) == 1) {
currentInstruction = Byte.parseByte(instructionCompileStack.pop());
currentAddress = Byte.parseByte(instructionCompileStack.pop());
engine.fillRAM(wordBuilder(currentInstruction, currentAddress));
} else if (getReqArgs(instructionCompileStack.peek()) == 0) {
currentInstruction = Byte.parseByte(instructionCompileStack.pop());
engine.fillRAM(wordBuilder(currentInstruction));
}
}
// compare this...
while (!instructionCompileStack.empty()) {
if (getReqArgs(instructionCompileStack.peek()) == 1) {
currentInstruction = Byte
.parseByte(instructionCompileStack.pop());
currentAddress = Byte.parseByte(instructionCompileStack
.pop());
engine.fillRAM(wordBuilder(currentInstruction,
currentAddress));
} else if (getReqArgs(instructionCompileStack.peek()) == 0) {
currentInstruction = Byte
.parseByte(instructionCompileStack.pop());
engine.fillRAM(wordBuilder(currentInstruction));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment