Cocoa Koans
Cocoa Koans
- Subject: Cocoa Koans
- From: Paul Ferguson <email@hidden>
- Date: Sat, 15 Dec 2001 15:47:12 -0800
I spent last week reading Aaron Hillegass' delightful "Cocoa Programming
for Mac OS X". To celebrate my new found enlightenment, I wrote these
Cocoa koans.
---------------------
A novice was struggling to determine whether his user defaults had
already been created. He tried adding a meta-tag to indicate their
existence, carefully checking its value so he could initialize
preferences for his users.
The master shook his head and smiled. "Your preferences already exist,
and always have", he said.
"But master, how will my users know them?", asked the student.
"They are created at the birth of time, before any objects", the master
replied, "They have the Cocoa-nature." He shut his eyes and began
snoring softly.
At that moment, the student was enlightened.
---------------------
"What does the file owner own?", asked the student.
"What does the file owner desire when it dreams?", replied the master.
---------------------
The student furrowed his brow, "If the target is not known, does an
action carry any meaning?"
"Yes, it can have more meaning than when the target is known", the
master explained. "Its meaning is given by the user, not the programmer."
"But will the user know the meaning?"
"Yes, unless he receives an EXC_BAD_ACCESS, then all bets are off."
---------------------
The novice wrote and compiled and debugged for many days. When he was
finished he hurried to the master.
After studying the novice's work carefully, the master paused for a
moment to gather his thoughts. Turning back to the screen, he touched
the mouse and spoke, "You have come a long way. Remember that the road
is long, and the journey is the reward."
The novice winced, but said nothing.
<fergy/>