Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

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