473,769 Members | 7,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I keep missing Hungarian naming; still smart to abandon?

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 little 3-character prefixes.

I'm fine with EmployeeFirstNa meLabel instead of lblEmployeeFirs tName, but at
the table and class level, I get frustrated because terms I want to use
reserved keywords.

I wanted "Event" and "User" as classes and table names. But, because those
are reserved words I have to be creative and come up with a non-ideal
alternative. Also, we have a class "Pen" which is allowed, but then can get
a little confusing (and I did say a little) with the Pen class in the
System.Drawing namespace (i.e. like when viewing Intellisense).

Now, I know I can bracket the table name but... yuk.

The main argument I hear against Hungarian is that a mouseover will tell you
the type so no need to type it in (especially since it could change). But
1) like many, I *read* code and seeing the type helps, and 2) refactoring
will allow me to easily retag my Hungarian tag with another.

Can someone please make me more comfortable leaving my Hungarian friend
behind? I'm not convinced that it's the best decision (from an app dev
standards policy in our shop).

Thanks,
Ron

Apr 24 '07
14 1551
I think that it's goddamn ridiculous to NOT use hungarian

at Microsoft; we all use hungarian STILL

On Apr 24, 6:15 am, "Ronald S. Cook" <r...@westinis. comwrote:
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 little 3-character prefixes.

I'm fine with EmployeeFirstNa meLabel instead of lblEmployeeFirs tName, but at
the table and class level, I get frustrated because terms I want to use
reserved keywords.

I wanted "Event" and "User" as classes and table names. But, because those
are reserved words I have to be creative and come up with a non-ideal
alternative. Also, we have a class "Pen" which is allowed, but then can get
a little confusing (and I did say a little) with the Pen class in the
System.Drawing namespace (i.e. like when viewing Intellisense).

Now, I know I can bracket the table name but... yuk.

The main argument I hear against Hungarian is that a mouseover will tell you
the type so no need to type it in (especially since it could change). But
1) like many, I *read* code and seeing the type helps, and 2) refactoring
will allow me to easily retag my Hungarian tag with another.

Can someone please make me more comfortable leaving my Hungarian friend
behind? I'm not convinced that it's the best decision (from an app dev
standards policy in our shop).

Thanks,
Ron

Apr 24 '07 #11
I'm not convinced either. At my work, we've standardized on naming
all elements with which we will programmaticall y interact
uxControlName, no matter their type. This groups them together in
intellisense. For labels, since you frequently have something like
lblFirstName and txtFirstName, we call those lblFirstName and
uxFirstName. For containers, such as a TableLayoutPane l, we use the
cnt prefix.

With that said, I'm not convinced that's the best way to go, either.
I think it's vastly more informative to see txtFirstName in your
code. It instantaneously tells you what the control does and what
type it is. In my personal projects, I'm not ready to let go of
hungarian at this time.

However, in SQL Server, I think it's improper form to use Hungarian
notation. tblCustomers looks bad, and you know it's a table. If
you're getting confused between views, tables, or even table valued
functions, then perhaps you need to do the suffix like Microsoft
suggests.

For your conflicting class names, such as Pen, I suggest you make a
short abbreviation alias in your using statements. For instance, if
your company name was Contoso and the full path to your Pen class was
Contoso.Windows .Controls.Writi ng.Instruments. Pen, then you could do
something as simple as:
using Contoso = Contoso.Windows .Controls.Writi ng.Instruments;

Then in your code, you can address it as:
private Contoso.Pen myPen = new Contoso.Pen();

I hope that helps you in your resolve to keep using Hungarian. Fight
the system! :)

Chris Benard
MCTS Windows, Web, SQL Server 2005

On Apr 24, 8:15 am, "Ronald S. Cook" <r...@westinis. comwrote:
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 little 3-character prefixes.

I'm fine with EmployeeFirstNa meLabel instead of lblEmployeeFirs tName, but at
the table and class level, I get frustrated because terms I want to use
reserved keywords.

I wanted "Event" and "User" as classes and table names. But, because those
are reserved words I have to be creative and come up with a non-ideal
alternative. Also, we have a class "Pen" which is allowed, but then can get
a little confusing (and I did say a little) with the Pen class in the
System.Drawing namespace (i.e. like when viewing Intellisense).

Now, I know I can bracket the table name but... yuk.

The main argument I hear against Hungarian is that a mouseover will tell you
the type so no need to type it in (especially since it could change). But
1) like many, I *read* code and seeing the type helps, and 2) refactoring
will allow me to easily retag my Hungarian tag with another.

Can someone please make me more comfortable leaving my Hungarian friend
behind? I'm not convinced that it's the best decision (from an app dev
standards policy in our shop).

Thanks,
Ron

Apr 24 '07 #12
Hey Ronald,
>From my experience, Its best not to worry about these sorts of things
and just get on with coding. If your contracting like myself, you'll
find different coding standards depending on where you work so really,
how you write your code shouldent be that important. A good coder will
stick to the standards currently used in the work place to make it
easy on future developments.

And really, if your coding at home for fun or something more serious,
your the only one looking at your code so whatever makes you happy
really.

And if your involved in a group project with people on the net, just
negotiate something and plug away at the real problem at hand.

Don't get caught up in little things like standards. Took me 10 years
to figure that out :)

Bye

On Apr 24, 11:15 pm, "Ronald S. Cook" <r...@westinis. comwrote:
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 little 3-character prefixes.

I'm fine with EmployeeFirstNa meLabel instead of lblEmployeeFirs tName, but at
the table and class level, I get frustrated because terms I want to use
reserved keywords.

I wanted "Event" and "User" as classes and table names. But, because those
are reserved words I have to be creative and come up with a non-ideal
alternative. Also, we have a class "Pen" which is allowed, but then can get
a little confusing (and I did say a little) with the Pen class in the
System.Drawing namespace (i.e. like when viewing Intellisense).

Now, I know I can bracket the table name but... yuk.

The main argument I hear against Hungarian is that a mouseover will tell you
the type so no need to type it in (especially since it could change). But
1) like many, I *read* code and seeing the type helps, and 2) refactoring
will allow me to easily retag my Hungarian tag with another.

Can someone please make me more comfortable leaving my Hungarian friend
behind? I'm not convinced that it's the best decision (from an app dev
standards policy in our shop).

Thanks,
Ron

Apr 25 '07 #13
Dom
I use Hungarian when I name controls, eg, btnNext, txtFilename, etc.
This sorts everything together in the intellisense window. But I
don't use it for variables. I think the argument there is that often
the type of the variable will change. Are you old enough to remember
wParam from the bad old days?

Dom
On Apr 24, 9:15 am, "Ronald S. Cook" <r...@westinis. comwrote:
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 little 3-character prefixes.

I'm fine with EmployeeFirstNa meLabel instead of lblEmployeeFirs tName, but at
the table and class level, I get frustrated because terms I want to use
reserved keywords.

I wanted "Event" and "User" as classes and table names. But, because those
are reserved words I have to be creative and come up with a non-ideal
alternative. Also, we have a class "Pen" which is allowed, but then can get
a little confusing (and I did say a little) with the Pen class in the
System.Drawing namespace (i.e. like when viewing Intellisense).

Now, I know I can bracket the table name but... yuk.

The main argument I hear against Hungarian is that a mouseover will tell you
the type so no need to type it in (especially since it could change). But
1) like many, I *read* code and seeing the type helps, and 2) refactoring
will allow me to easily retag my Hungarian tag with another.

Can someone please make me more comfortable leaving my Hungarian friend
behind? I'm not convinced that it's the best decision (from an app dev
standards policy in our shop).

Thanks,
Ron

Apr 25 '07 #14
underscore naming convention sucks

an underscore is a wildcard character; stfu kid


On Apr 24, 10:47 am, Jon Skeet [C# MVP] <s...@pobox.com wrote:
Peter Duniho <NpOeStPe...@Nn OwSlPiAnMk.comw rote:

<snip>
I certainly don't see the point in switching your coding conventions just
because Microsoft has changed their mind about what the "standard" is. If
you do switch to the .NET conventions internally, you should do so because
there's some real benefit to *your* development team in doing so.

While I take your point, I think that consistency is a benefit in and
of itself. It would look very odd to, say, have all your own method
names in the_c_style_of_ naming_with_und erscores and still be calling
FrameworkMethod sWithPascalCasi ng. It just looks uneven and
inconsistent.

As you say though, there's nothing to stop you from naming variables
however you like.

--
Jon Skeet - <s...@pobox.com >http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

May 7 '07 #15

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

Similar topics

66
3711
by: CMM | last post by:
So after three years of working in .NET and stubbornly holding on to my old hungarian notation practices--- I resolved to try to rid myself of the habit. Man, I gotta say that it is liberating!!! I love it. At first I struggled with how to name controls. I tried to keep some sort of notation with them... but I threw that away too!!! I now name them as if they were simply properties of the form (FirstNameLabel, etc.)... which they ARE!......
24
3838
by: Ronald S. Cook | last post by:
An ongoing philosophical argument, I would like your opinions. With the release of .NET, Microsoft spoke of moving away from the notation as a best practice. I'm a believer for a few reasons: 1) Consistency throughout and knowing which objects are yours (clsEmployee, tblEmployee, frmEmployee, etc). 2) Not having to name an employee form EmployeeForm.aspx because the mane is already taken by your class named Employee.cs
24
2378
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? I tend to use it a lot, especially when IDing my controls. For instance the controls in a contact form I create could be IDed as such:
6
4069
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 using out there and why. Thanks!
3
10562
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 using out there and why. Thanks!
3
1596
by: Ronald S. Cook | last post by:
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
12
3598
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
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10048
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.