Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

PDF:

BKeeney Briefs

Naming Conventions

Bad naming is a giveaway for bad coding

Issue: 7.4 (May/June 2009)
Article Description: No description available.
Article Length (in bytes): 3,164
Starting Page Number: 54
RBD Number: 7417
Resource File(s): None
Related Web Link(s):

http://en.wikipedia.org/wiki/Hungarian_notation

Known Limitations: None

Excerpt of article text...

This is a followup to my "Other People's Code" column. Since then I've been lucky enough to look at a few more OPC projects. The difference between one that's going to be a breeze and one that's going to be difficult is easy to spot right away: naming conventions.

If you don't have standard naming conventions in your REALbasic (or any other language for that matter) project you need to start now. I mean it. Open your IDE of choice and start looking at your variable names. Can you tell at a glance what type of variable it is? Can you tell what it does? Or do you have a bunch of x, i, y, and z's floating around in your code?

What about your editfields? Do you name them so you can tell their function or do you simply use the default name that the IDE gives you? How do you tell the difference between EditField1 and EditField2?

Literally, the first thing I do when handed an OPC project is to look at the control names. If I see EditField1 and EditField2 I will almost always turn the project down. But if I see efName and efAddress or txtName and txtAddress I know that I can figure out the code. The point is that controls are referenced in RB code all the time so if you're naming your controls so that their function is obvious, the code will be obvious too.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com