Results 1 to 6 of 6

Thread: Coding/Naming Convention?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Singapore
    Posts
    13

    Coding/Naming Convention?

    Hi all, I read that Microsoft VB .NET naming convention is MyCar and those things. I understand that Microsoft is sort of moving away from using strMyCar for string and so on.

    But I would like to know how do you all naming your form components like Button, Label, ListBox... in VB .NET? Do you all use btnMyButton or just MyButton? What should I use?

    Microsoft never seems to touch on this and I would like to follow a standard convention.

    Thx
    DES!GNBRANZ @ http://www.des!gn.bz

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    The prefixes have been removed from the naming conventions, and I am glad about that.

    In my humble experience, I have seen comboboxes with the txt prefix, textboxes with the cbo prefix, Long integers with the int prefix etc.

    The problem with these prefixes is that they either work confusing when the program needs to be changed (integer is changed into long, or textbox is changed into a combobox) and the easy solution is chosen (just change the object, don't change the name), or they increase the time needed to make the change (where is the variable or object name used?, you have to change them all).

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Dont gain the world and lose your soul

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Singapore
    Posts
    13
    Yah, I understand the trouble of when the type is changed later and I am glad the prefix naming convention is now "out". I am somehow confused when trying to name my Form Components.

    I guess if I have a Label with Myself as title, then I would just name the label as MyselfLabel? Or just MyselfTitle? Its quite unlikely that we will change the "type" of component for the variable right. If I do not name the IDE components as what they are like label, button, listbox, I wouldn't know what properties they have and would confuse with created variables.
    DES!GNBRANZ @ http://www.des!gn.bz

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Singapore
    Posts
    13
    Originally posted by DevGrp
    Check here. http://msdn.microsoft.com/library/de...guidelines.asp
    I checked there before. They highlighted method, classes, variables naming and so on. They never highlight how I should name my form components like labels, buttons, listbox and so on. So I was wondering what standard I should use.
    DES!GNBRANZ @ http://www.des!gn.bz

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    in C# we use the camel Case convention
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width