Skip to main content

Do Ya

Posted by editor on January 3, 2007 at 11:41 AM PST

Who is "me" and "you" in computer terminology?

During the break, I took a QuickTime example written in C and ported it to Java (and then posted it). Touring the Apple code reminded me how annoying C can be (native QuickTime usually reserves return values for error codes since C doesn't have exceptions, so if you want something returned, you have to pass in an address where you'll receive a pointer... yuck). The other thing that was striking was the constant use of "my" variables in Apple's sample code... mySndTrack, myMedia, myInputMap, myTweenData, etc.

I don't fully understand the idea behind the "my" variables. I guess it does help to distinguish between the sample's variables and constants versus those inherited from imports (another thing that makes C less readable to me... I'd rather see something like ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS so I know where a value is coming from), but if that's the case, then it's just a coping mechanism against a C code smell. Sure, maybe they're "my" variables in the context of an example, to remind me of what the sample code is responsible for managing versus what's coming from a library, but I can't help but think that this will lead to bad programming practices among newer programmers. I would hate to see a 100,000-line enterprise program with a naming scheme so ambiguous as to use myAccount, myDbConnection, etc.