May 19, 2006
The Craftsman: isTooHotForMe!Even when they're off duty, our apprentices aren't afraid to tackle enums, heating things up with tacos and salsa and wowing Jasmine and Jerry amidst giggles and rolling eyes.Robert C. Martin
Even when they're off duty, our apprentices aren't afraid to tackle enums, heating things up with tacos and salsa and wowing Jasmine and Jerry amidst giggles and rolling eyes.
Sept, 1944. President Henry Wallace buried his face in his hands. "Perhaps we deserve to be destroyed," he said to an uncaring universe. The extermination of the human race seemed assured on several fronts. Clyde was coming in 15 years, and there didn't seem to be anything to be done about it. The Third Reich was systematically exterminating whole races of people. Stalin continued his purges against anyone with contrary ideologies. The American monopoly on atomic weapons couldn't last much longerand then there would be war and destruction on a scale that only Clyde could rival. Indeed, perhaps Clyde was simply God's undertaker, sent to bury an Earth that was already dead. There was a knock at the door. "Mr. President? Dr. Von Braun is here to see you."
Feb. 28, 2002, 1100: Avery and I arrived in the small conference room that we used for our daily discussions. I assumed that the scowl on his face had something to do with the fact that Jerry and Jasmine were right behind us. We sat down and Jerry said, "Whose turn is it today?" Avery's scowl deepened, but he remained silent.
"Avery and I usually take turns," I said. "But Avery didn't get his turn yesterday, so ..."
Avery sent a cold glance at Jerry but said, "Never mind, Alphonse. It's your turn. Go ahead."
"I don't have much prepared," I said, "but I do have a question. Has anyone seen the new
Avery was suddenly very alert. "Can you write an example on the wall, Alphonse?"
I used my finger to write the following code on the wall panel:
public class Taco {
enum Color {red, green, burntumber}
}
"We all know that Java 1.5 has enums that look like this," I said. "They're essentially integer constants."
Avery jumped to the wall and started writing and talking at the same time. "Yeah, before 1.5 we would have done this:"
public class Taco {
public static final int RED = 0;
public static final int GREEN = 1;
public static final int BURNT_UMBER = 2;
}
|
|
||||||||||||||||||||||||||||||
|
|
|
|