473,387 Members | 1,606 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,387 software developers and data experts.

How name employee first name label and textbox, if not via Hungarian notation?

For all those anti-Hungarian notation people out there, how would you name
an employee first name label and textbox on an create/modify employee form,
respectively (please)?

Thanks,
Ron

Mar 17 '08 #1
3 1573
On Mon, 17 Mar 2008 11:03:56 -0700, Ronald S. Cook <rc***@westinis.com>
wrote:
Thanks Pete. My main problem is that, since we abandoned silly
Hungarian notation (against my wishes), we are now naming things as
"FirstNameTextBox" instead of txtFirstName. To me this is just the same
as Hungarian, just post, not pre.. and longer (although one doesn't need
a reference lookup to know txt is for TextBox).
Well, if you need to distinguish between two things that both relate to
"FirstName", you need _something_. Yes, putting the type as that
qualifier does make it seem a lot like Hungarian, but I don't think it's
really doing the same thing. It only provides semantic type information
by coincidence, and mainly it's just allowing you to distinguish from the
label version of the same thing.

In fact, that's why I think that "FirstNameField", or "FirstNameEdit" (to
name another possibility) is just as useful as "FirstNameTextBox". I
would agree that they are not as useful as an actual Hungarian naming
scheme, but it's not like they aren't useful and that naming convention
does serve the purpose of providing immediately readable names (which
addresses the most common complaint against Hungarian).

And as I suggested, in most cases you wouldn't even need a member field
for the Label control, in which case you could leave off the qualifier on
the TextBox control's member field altogether.

By the way, the names I offered as a suggestion would actually only be
suitable for a property, not a field. Following the .NET naming
convention, "camel case" would be appropriate for fields. So
"FirstNameField" becomes "firstNameField", etc.
It just doesn't seem to me that the arguments against Hungarian outweigh
the arguments for it. But Hungarian gets a bad rap as being
mickey-mouse/the old way/not what "real" engineers do.
Well, you won't get any argument from me with respect to the usefulness of
Hungarian. I'm probably one of the last people writing .NET/C# code with
Hungarian. I use it in Java too, in spite of the rabid derision spewed by
certain members of the Java community toward anyone that doesn't follow
Sun's naming convention.

But as useful as I find Hungarian, IMHO it's more important in a team
situation to find a convention that everyone can accept and which is still
reasonably useful. I don't find .NET's conventions as useful as
Hungarian, but they aren't bad either. Being consistent is more important
sometimes than being perfect. :)

Pete
Mar 17 '08 #2
I absolutely agree with Ronald and have reverted back to Hungarian. The
arguments to abandon Hungarian are fallacious, unsound and pragmatically
wasteful if even at the micro-level, the argument it is what it is and is
what it was; a terrible idea imposed by shallow minded thinkers presuming
the use of Intellisense would prove sufficient. Worse yet, when proven how
illogical their fallacy they usually skulk away in denial or pull rank while
sniffing their haughty nose in the air.

<%= Clinton Gallagher

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 17 Mar 2008 11:03:56 -0700, Ronald S. Cook <rc***@westinis.com>
wrote:
>Thanks Pete. My main problem is that, since we abandoned silly
Hungarian notation (against my wishes), we are now naming things as
"FirstNameTextBox" instead of txtFirstName. To me this is just the same
as Hungarian, just post, not pre.. and longer (although one doesn't need
a reference lookup to know txt is for TextBox).

Well, if you need to distinguish between two things that both relate to
"FirstName", you need _something_. Yes, putting the type as that
qualifier does make it seem a lot like Hungarian, but I don't think it's
really doing the same thing. It only provides semantic type information
by coincidence, and mainly it's just allowing you to distinguish from the
label version of the same thing.

In fact, that's why I think that "FirstNameField", or "FirstNameEdit" (to
name another possibility) is just as useful as "FirstNameTextBox". I
would agree that they are not as useful as an actual Hungarian naming
scheme, but it's not like they aren't useful and that naming convention
does serve the purpose of providing immediately readable names (which
addresses the most common complaint against Hungarian).

And as I suggested, in most cases you wouldn't even need a member field
for the Label control, in which case you could leave off the qualifier on
the TextBox control's member field altogether.

By the way, the names I offered as a suggestion would actually only be
suitable for a property, not a field. Following the .NET naming
convention, "camel case" would be appropriate for fields. So
"FirstNameField" becomes "firstNameField", etc.
>It just doesn't seem to me that the arguments against Hungarian outweigh
the arguments for it. But Hungarian gets a bad rap as being
mickey-mouse/the old way/not what "real" engineers do.

Well, you won't get any argument from me with respect to the usefulness of
Hungarian. I'm probably one of the last people writing .NET/C# code with
Hungarian. I use it in Java too, in spite of the rabid derision spewed by
certain members of the Java community toward anyone that doesn't follow
Sun's naming convention.

But as useful as I find Hungarian, IMHO it's more important in a team
situation to find a convention that everyone can accept and which is still
reasonably useful. I don't find .NET's conventions as useful as
Hungarian, but they aren't bad either. Being consistent is more important
sometimes than being perfect. :)

Pete
Mar 18 '08 #3
I absolutely agree with Ronald and have reverted back to Hungarian. The
arguments to abandon Hungarian are fallacious, unsound and pragmatically
wasteful if even at the micro-level, the argument it is what it is and is
what it was; a terrible idea imposed by shallow minded thinkers presuming
the use of Intellisense would prove sufficient. Worse yet, when proven how
illogical their fallacy they usually skulk away in denial or pull rank while
sniffing their haughty nose in the air.

D.) All of the above.

<%= Clinton Gallagher

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 17 Mar 2008 11:03:56 -0700, Ronald S. Cook <rc***@westinis.com>
wrote:
>Thanks Pete. My main problem is that, since we abandoned silly
Hungarian notation (against my wishes), we are now naming things as
"FirstNameTextBox" instead of txtFirstName. To me this is just the same
as Hungarian, just post, not pre.. and longer (although one doesn't need
a reference lookup to know txt is for TextBox).

Well, if you need to distinguish between two things that both relate to
"FirstName", you need _something_. Yes, putting the type as that
qualifier does make it seem a lot like Hungarian, but I don't think it's
really doing the same thing. It only provides semantic type information
by coincidence, and mainly it's just allowing you to distinguish from the
label version of the same thing.

In fact, that's why I think that "FirstNameField", or "FirstNameEdit" (to
name another possibility) is just as useful as "FirstNameTextBox". I
would agree that they are not as useful as an actual Hungarian naming
scheme, but it's not like they aren't useful and that naming convention
does serve the purpose of providing immediately readable names (which
addresses the most common complaint against Hungarian).

And as I suggested, in most cases you wouldn't even need a member field
for the Label control, in which case you could leave off the qualifier on
the TextBox control's member field altogether.

By the way, the names I offered as a suggestion would actually only be
suitable for a property, not a field. Following the .NET naming
convention, "camel case" would be appropriate for fields. So
"FirstNameField" becomes "firstNameField", etc.
>It just doesn't seem to me that the arguments against Hungarian outweigh
the arguments for it. But Hungarian gets a bad rap as being
mickey-mouse/the old way/not what "real" engineers do.

Well, you won't get any argument from me with respect to the usefulness of
Hungarian. I'm probably one of the last people writing .NET/C# code with
Hungarian. I use it in Java too, in spite of the rabid derision spewed by
certain members of the Java community toward anyone that doesn't follow
Sun's naming convention.

But as useful as I find Hungarian, IMHO it's more important in a team
situation to find a convention that everyone can accept and which is still
reasonably useful. I don't find .NET's conventions as useful as
Hungarian, but they aren't bad either. Being consistent is more important
sometimes than being perfect. :)

Pete
Mar 18 '08 #4

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

Similar topics

14
by: Denny | last post by:
For most of my variable names, I use Hungarian notation to determine between one and the other. But what names can I use for public and private variables? I was using prv_varName and pub_varName...
28
by: Phill | last post by:
Does anyone know the reasoning for Microsoft abandoning Hungarina Notation in C#? I have found it very usefull in C++. I like this style: constant: MY_CONSTANT methos: myMethod() class: ...
4
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting...
24
by: darrel | last post by:
I just discovered that MS recommends that we NOT use hungarian notation with the .net framework: http://msdn2.microsoft.com/en-us/library/ms229045.aspx What are the real cons for using it? ...
6
by: Grey Squirrel | last post by:
On wednesday my company will have an open ended discussion whether to standardize hungarian notation or pascal/cammel case notation. We'd love to recieve some feedback on what other people are...
3
by: Grey Squirrel | last post by:
On wednesday my company will have an open ended discussion whether to standardize hungarian notation or pascal/cammel case notation. We'd love to recieve some feedback on what other people are...
2
by: =?Utf-8?B?bmt3?= | last post by:
I usually name the controls as txtSomething, ddlSomething, gvSomething. However, the FXCop indicate it's an error and Pascal convention is preferred. Any good suggesion on ASP.Net control name...
14
by: Ronald S. Cook | last post by:
I've been weaning myself off of Hungarian notation because that's what Microsoft is telling me to do, and I want to be a good little MS developer. But things keep coming up that make me miss my...
12
by: inhahe | last post by:
Does anybody know of a list for canonical prefixes to use for hungarian notation in Python? Not that I plan to name all my variables with hungarian notation, but just for when it's appropriate.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.