Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Naming Convention

Reply
Thread Tools

Naming Convention

 
 
sck10
Guest
Posts: n/a
 
      09-25-2006
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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      09-25-2006
"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...


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-25-2006
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
>



 
Reply With Quote
 
tdavisjr
Guest
Posts: n/a
 
      09-25-2006
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
>

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-25-2006
"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!


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      09-26-2006
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.

 
Reply With Quote
 
sck10
Guest
Posts: n/a
 
      09-26-2006
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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Naming Convention for ASP.NET BAL/DAL? dm1608 ASP .Net 6 02-24-2006 07:25 PM
WS C3550 naming convention question frishack@gmail.com Cisco 2 02-23-2005 07:29 PM
JSP Method Naming Convention Buck Turgidson Java 1 03-02-2004 04:43 PM
Which c# naming convention? Rick ASP .Net 1 01-19-2004 11:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57