Many thanks to Tristan Morris for creating a beautiful illustrated hardcover print edition of the site

tcc-case-title
extremely geeky  extremely geeky

Case 65

Two Choices

(Sorry, this page has not yet been translated into the requested language.)

Java master Kaimu left three novices to debate the signature of a utility method that was needed. An hour later he found all three in his office, bruised and quite dissheveled.

“Have you reached agreement?” asked Kaimu.

The first novice, sporting a torn robe and cut lip, said: “We are even further from a peaceful conclusion than before. Each of us still prefers his own solution to the two others. We beg you to make the best choice on our behalf.”

“Very well,” sighed Kaimu. “Among the three options offered, one was bold enough to reject our tradition of strong typing and declare the method to take an Object, so as to satisfy all potential users. Which of you proposed this?”

The second novice proudly stepped forward. With a swift kick to the stomach, the master sent him tumbling out the door.

Qi’s commentary

The method that takes Object will cheerfully accept LeftFoot.

Qi’s poem

A perfect frog crouches on the table,
surrounded by shards of jade.
With each blow, the sculptor has two choices:
for, against.

Topics...  strong typing