New topic: Variable Naming
<http://forums.realsoftware.com/viewtopic.php?t=43913> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message jm5464 Post subject: Variable NamingPosted: Mon May 07, 2012 12:22 pm Joined: Sun Dec 26, 2010 7:29 pm Posts: 47 RB can't handle items of different types spelled the same in the same scope, so occasionally I run into situations where I have to use sub-optimal naming to get around this. I was wondering how the pros name their variables to get around these situations? For example, if have Class "Foo" that has an Enum "FooType" but also want a Property "FooType" of type "FooType" to hold the current value, how do we handle this? Top Bob Keeney Post subject: Re: Variable NamingPosted: Mon May 07, 2012 12:46 pm Joined: Fri Sep 30, 2005 11:48 am Posts: 2993 Location: Lenexa, KS We get around this by using prefixes. An enum always has an 'e' prefix so that your example would be eFooType. Properties of a class tend to have an 'o' prefix so your example would have be oFooType. I'm sure there are other examples, but we try to be use our Naming Standards and Coding Conventions document as our guide. That we when they're referenced in code we know, to a certain extent, what they are without having to refer to their definitions. _________________ Bob K. 30+ hours of Real Studio Video Training (including over 6 hours of Web Edition) at http://www.bkeeney.com/ Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/ Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
