473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Naming Convention

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
Sep 25 '06 #1
6 1262
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" <sc***@online.nospamwrote in message
news:OS****************@TK2MSFTNGP03.phx.gbl...
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

Sep 25 '06 #2
"sck10" <sc***@online.nospamwrote in message
news:OS****************@TK2MSFTNGP03.phx.gbl...
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...
Sep 25 '06 #3
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" <sc***@online.nospamwrote in message
news:OS**************@TK2MSFTNGP03.phx.gbl...
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
Sep 25 '06 #4
"tdavisjr" <td******@gmail.comwrote in message
news:O1**************@TK2MSFTNGP06.phx.gbl...
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!
Sep 25 '06 #5
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.

Sep 26 '06 #6
All,

Thanks for the feedback...

sck10
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:UJ**************@TK2MSFTNGXA01.phx.gbl...
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.

Sep 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Derek | last post by:
The company where I work uses a naming convention that I have never used before. They use mixed-case letters for public member functions, but lower-case with underscores for the rest, like this:...
7
by: cmiddlebrook | last post by:
Hi there, I keep finding myself getting inconsistent with naming conventions for things like member variables, class names etc and I just want to find something that suits me and stick to it. I...
4
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
14
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
0
by: Carl Colijn | last post by:
Hi all, Disclaimer: before I might trigger your "let's start a holy war!" button, I'd like to say I'm not intended to; I just post this message to get some input and not to promote "Yet Another...
10
by: jjkboswell | last post by:
I'm trying to pin down a good naming convention for the 3 things required to implement an event. You need: 1) a delegate 2) an event 3) an event handler Below is my understanding of a...
11
by: MP | last post by:
Hi, Coming from a vb6 background I am accustomed to prefixing variable names to indicate their usage. Now just beginning to try to learn database stuff I've been lurking here and working on my...
6
by: dm1608 | last post by:
I'm relatively new to ASP.NET 2.0 and am struggling with trying to find the best naming convention for the BAL and DAL objects within my database. Does anyone have any recommendations or best...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
35
by: Smithers | last post by:
Is it common practise to begin the name of form classes with "frm" (e.g., frmOneForm, frmAnotherForm). Or is that generally considered an outdated convention? If not "frm" what is a common or...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.