• TJ (unregistered)

    Jeezus enough with the damn VB6 naming conventions. You programming in C#!!!! Read the damn help files, they provide the naming convention you should use.

    Thank You :)

  • cooper (unregistered)

    No kidding. I have more than a couple people I work with that still use the VB naming stuff in their Java and it makes me want to scream.

  • qwerty (unregistered)

    Some hungarian is still good. If you faithfully distinguish member/global/class vars from the locals, it is must easier to find side-effects.

    It can make your constructors pretty too:
    class foo { foo(int var) { _var = var } ...

    ymmv

  • anonymous (unregistered)

    I prefer to do this:

    class foo { foo(int var) { this.var = var; }

  • mjwills (unregistered)

    qwerty,

    <quote>
    It can make your constructors pretty too:
    class foo { foo(int var) { _var = var } ...
    </quote>

    Using _ before a variable name is not hungarian.

    Seeya
    Matthew

  • Matt K (unregistered)

    The VB naming conventions is not what makes this so damned funny.


    strMsgICN75964 = "ICN75964"; ?!?!?!

    How about picking a variable name that really means something. HELLO!?

  • Frans Bouma (unregistered)

    "How about picking a variable name that really means something. HELLO!?"
    Perhaps ICN875964 is a code well known to the users of teh application. I really don't see what's so odd about the code.

  • Grimley (unregistered)

    Frans said: "Perhaps ICN875964 is a code well known to the users of teh application. I really don't see what's so odd about the code."

    As your comment demonstrates, it's hard to repeatedly type such a strange sequence. You added an 8 that shouldn't be there, but it doesn't "look" wrong unless you look closely digit by digit.

    It would be more useful, and meaningful even to people who use/maintain that system, to give it a more generic name like "strAlertMsg" or something related to it's purpose, not it's arcane content.

  • Ross (unregistered)

    Naming conventions here:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp

    This only addresses externally visible members. What's the recommendation for local private variables? I've seen names starting with underscores. What do others do?

  • Martinator (unregistered)

    "What do others do?" I used to work at M$ and we used a coding standards tool similar to fxCop that checked your naming against M$ Longhorn coding standards. Basically internal members should always be referenced as this.variable no underscores or m prefixes allowed anymore.

  • Alex Papadimoulis (unregistered)

    I don't believe that anyone who refers to Microsoft as "M$" every worked there. Well, maybe serving up drinks in the on-campus Starbucks ... but definately not as a coder or anything related to software development.

  • Ross (unregistered)

    Thanks Martinator but that doesn't really answer my question. this.variable is fine but what form does variable take? Often its the same name as a property so how do you distingish it? By case (property = Pascal, local variable = camel) or something else?

  • mjwills (unregistered)

    Matt K,

    <quote>
    The VB naming conventions is not what makes this so damned funny.
    </quote>

    Definitely. My response was based on qwerty's statement rather than the humour of the original post.

    Seeya
    Matthew

  • Martinator (unregistered)

    It should be distinguished by case or use a different name. All public properties should start with an upercase and all internal variable should start lowercase:

    private int count = 0;
    public int Count
    {
    ...
    }

    You should always go through the property if possible, not the internal variable.

  • Anonymous (unregistered)

    What an idiot, those should be constants!

  • Dave Babbitt (unregistered)

    I don't get why that's an issue.

  • eznme (unregistered)

    TRWFT is what the strings' contents might be used for!

Leave a comment on “Stating The Obvious”

Log In or post as a guest

Replying to comment #:

« Return to Article