AKMA's Random Thoughts

October 17, 2003

Last Night at DigID

Last night we all attended the dinner that honored three DigID luminaries. I was at a table with Chris Locke, Marc Canter, Doc Searls, Elliot Noss (beside whom I sat at last year’s banquet, too), Simon Grice, Peter Biddle, and several of the guys behind the nTags most of us are lugging around. Peter won one of the DigID awards for Microsoft’s Palladium/NGSCB endeavor — an award that was not universally applauded. (Our table was adjacent to the table with Cory and the BBC delegates, a relative island of tepid enthusiasm.) (Peter, as you will see below, is a Good Sport about these matters; he conversed with some of us at length about how bad a PR year the Evil Empire West, as distinct from the George Steinbrenner’s Evil Empire East, has endured.)

After dinner, a crowd of us decamped to the hotel sports bar to watch with horror as the baseball season came to an end. Yes, Kassinda, the Yankees will play another four or five games, but there’s no reason to pay much attention anymore. During the agony, we struck up a series of shuffleboard games. At first, we guessed at the rules, and in a couple of imprecise non-games, Alice and Fiona and Nat and Cory and I skidded pucks around (I 0wnz0red — but these have to count as nothing more than a spring training version of the real games that ensued once we learned the rules).

When we got down to brass tacks, the team of Bryan and Fiona fell to Alice and Cory. Then representatives of God and Satan joined forces; Peter "DigID Ice Cube of Quality" Biddle and I teamed up to conquer the previous champions. Various subsequent games passed, including a Battle of the Sexes between Alice and Fiona and Cory and Peter, and the night wound down with Peter and me succumbing to Bryan and Simon in a winner-take-all death match. Well played, all, and took some of the edge off Pedro’s collapse.

Identity.

Posted by AKMA at October 17, 2003 10:41 AM | TrackBack
Comments

That gives us a pretty good starting point to understand a lot more about variables, and that's what we'll be examining next lesson. Those new variable types I promised last lesson will finally make an appearance, and we'll examine a few concepts that we'll use to organize our data into more meaningful structures, a sort of precursor to the objects that Cocoa works with. And we'll delve a little bit more into the fun things we can do by looking at those ever-present bits in a few new ways.

Posted by: Faustinus at January 12, 2004 08:48 PM

This code should compile and run just fine, and you should see no changes in how the program works. So why did we do all of that?

Posted by: Joyce at January 12, 2004 08:49 PM

Our next line looks familiar, except it starts with an asterisk. Again, we're using the star operator, and noting that this variable we're working with is a pointer. If we didn't, the computer would try to put the results of the right hand side of this statement (which evaluates to 6) into the pointer, overriding the value we need in the pointer, which is an address. This way, the computer knows to put the data not in the pointer, but into the place the pointer points to, which is in the Heap. So after this line, our int is living happily in the Heap, storing a value of 6, and our pointer tells us where that data is living.

Posted by: Julius at January 12, 2004 08:49 PM

When the machine compiles your code, however, it does a little bit of translation. At run time, the computer sees nothing but 1s and 0s, which is all the computer ever sees: a continuous string of binary numbers that it can interpret in various ways.

Posted by: Holland at January 13, 2004 09:03 AM

Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.

Posted by: Watkin at January 13, 2004 09:03 AM

Seth Roby graduated in May of 2003 with a double major in English and Computer Science, the Macintosh part of a three-person Macintosh, Linux, and Windows graduating triumvirate.

Posted by: Paschall at January 13, 2004 09:04 AM