Tuesday, April 25, 2006

Example: showAd();

Believe it or not, what we learned in school still stands: Using descriptive naming conventions are helpful. For example...

Using Gus' IM Control Panel, you'll find that the AIM code has been beautifully separated into subfolders with obvious naming conventions.

  • The "bl" folder, for instance, stands for Buddy List. And in there,
  • The "bl.js" file, represents the main script code for the buddy list.
Okay Okay. So you're thinking, "Big Deal. Anyone can name folders and files with an obvious naming scheme. How about with code!?" Well hold your horses. Going back to the example above, you'll find:

  • bl.js has a function called showAd();
So anytime you're in that file and you see this.showAd(), you never have to stop and think..."Hmmm, now what does that function call do again?"

No comments: