Naming Convention

Discussion in 'ASP .Net' started by sck10, Sep 25, 2006.

  1. sck10

    sck10 Guest

    Hello,

    Numerous people have kindly commented on my use of the Hungarian style
    naming convention, which I am appreciative of. In trying to move away from
    this naming style, I have run into some difficulty. For example, I have a
    application that has something like the following:

    Text Box: txtLastName
    Label: lblLastName
    HiddenValue: hdnLastName

    In terms of best practice, how should I name these three objects? Any help
    with this would be appreciated.

    Thanks, sck10
     
    sck10, Sep 25, 2006
    #1
    1. Advertising

  2. sck10

    Mark Rae Guest

    "sck10" <> wrote in message
    news:OShK%...

    > In trying to move away from this naming style,


    Why are you trying to do that...?

    > Text Box: txtLastName
    > Label: lblLastName
    > HiddenValue: hdnLastName


    Looks fine to me - if it ain't broke, don't fix it...
     
    Mark Rae, Sep 25, 2006
    #2
    1. Advertising

  3. Looks fine to me, I am also using the same "camel" style if the declaration
    are private. Public and protected names usually start with a capital.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "sck10" <> wrote in message
    news:OShK%...
    > Hello,
    >
    > Numerous people have kindly commented on my use of the Hungarian style
    > naming convention, which I am appreciative of. In trying to move away
    > from this naming style, I have run into some difficulty. For example, I
    > have a application that has something like the following:
    >
    > Text Box: txtLastName
    > Label: lblLastName
    > HiddenValue: hdnLastName
    >
    > In terms of best practice, how should I name these three objects? Any
    > help with this would be appreciated.
    >
    > Thanks, sck10
    >
     
    Eliyahu Goldin, Sep 25, 2006
    #3
  4. sck10

    tdavisjr Guest

    Well, this all started when MSFT released a document stating that Hungarian
    style programming is discouraged. I don't see why for so many years this was
    quite fine; but now all of the sudden with .NET it is discouraged. You can
    use variation of styles. They recommend stuff like:

    lastNameTextBox
    LastName
    lastName

    but to tell you the truth, this is all hogwash. If you find a style that
    your are comfortable with, stick with it. Or, if you company has a set
    standard use it. Otherwise, ignore what others are saying. Is is
    non-productive.


    "sck10" <> wrote in message
    news:OShK#...
    > Hello,
    >
    > Numerous people have kindly commented on my use of the Hungarian style
    > naming convention, which I am appreciative of. In trying to move away
    > from this naming style, I have run into some difficulty. For example, I
    > have a application that has something like the following:
    >
    > Text Box: txtLastName
    > Label: lblLastName
    > HiddenValue: hdnLastName
    >
    > In terms of best practice, how should I name these three objects? Any
    > help with this would be appreciated.
    >
    > Thanks, sck10
    >
     
    tdavisjr, Sep 25, 2006
    #4
  5. sck10

    Mark Rae Guest

    "tdavisjr" <> wrote in message
    news:...

    > Well, this all started when MSFT released a document stating that
    > Hungarian style programming is discouraged. I don't see why for so many
    > years this was quite fine; but now all of the sudden with .NET it is
    > discouraged. You can use variation of styles. They recommend stuff like:
    >
    > lastNameTextBox
    > LastName
    > lastName
    >
    > but to tell you the truth, this is all hogwash. If you find a style that
    > your are comfortable with, stick with it. Or, if you company has a set
    > standard use it. Otherwise, ignore what others are saying. Is is
    > non-productive.


    I couldn't agree more!
     
    Mark Rae, Sep 25, 2006
    #5
  6. Hi Steve,

    I think tdavisjr has given you a quite good answer:

    ===============
    If you find a style that your are comfortable with, stick with it. Or, if
    you company has a set standard use it. Otherwise, ignore what others are
    saying. Is is non-productive.
    ==============

    Just coding as you like :)

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Sep 26, 2006
    #6
  7. sck10

    sck10 Guest

    All,

    Thanks for the feedback...

    sck10


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Steve,
    >
    > I think tdavisjr has given you a quite good answer:
    >
    > ===============
    > If you find a style that your are comfortable with, stick with it. Or, if
    > you company has a set standard use it. Otherwise, ignore what others are
    > saying. Is is non-productive.
    > ==============
    >
    > Just coding as you like :)
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    sck10, Sep 26, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick

    Which c# naming convention?

    Rick, Jan 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,783
    Paul Glavich
    Jan 19, 2004
  2. dm1608
    Replies:
    6
    Views:
    8,524
  3. Buck Turgidson

    JSP Method Naming Convention

    Buck Turgidson, Mar 2, 2004, in forum: Java
    Replies:
    1
    Views:
    1,756
    P.Hill
    Mar 2, 2004
  4. harry
    Replies:
    2
    Views:
    1,196
    harry
    Dec 8, 2004
  5. Roedy Green

    Naming Convention(s)

    Roedy Green, Sep 3, 2005, in forum: Java
    Replies:
    24
    Views:
    973
    Dale King
    Sep 12, 2005
Loading...

Share This Page