locked
Best practice RRS feed

  • Question

  • User2043512157 posted

    Hi,


    I'm pretty new to all this but it doesn't mean I shouldn't go about things in the right way.

    I'm looking for advice on how to ref classes within my code


    For instance:


    I have a class MyClass which contains a number of variables

    When I reference this in code I might say:

    MyClass myClass = new MyClass();


    Then refence the contents of the class:

    string myName = myClass.Name;


    The question I have is what is the best practice for naming the instance "myClass"?  Should it be a full and clear name like "myClass" or should I use a shortened version to avoid bloating, such as:

    MyClass mc = newMyClass();

    string myName = mc.Name;


    Thanks in advance.

    Friday, May 14, 2010 5:27 AM

Answers

All replies