473,769 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hungarian Notation Vs. Pascal Notation?

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!

Mar 19 '07 #1
6 4069
I'd love to work at your company (not)

:)

Use camel for c# and Pascal for VB cos that's just the standard. There,
I've saved you a meeting.

Just use what you want.

"Grey Squirrel" <ak*******@gmai l.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
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!

Mar 19 '07 #2
a very strict "non hungarian policy" here.

However, hungarian is used and recommended for UI components.

txtFirstName
ddlDepartment

...

string lastName = "Jones";
int deptId = 0;

"Grey Squirrel" <ak*******@gmai l.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
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!

Mar 19 '07 #3
On Mar 19, 9:34 am, "Grey Squirrel" <akataw...@gmai l.comwrote:
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!
We use pascal and cammel case. Not only because it is the standard
coding convention for .NET as seen in

* http://msdn2.microsoft.com/en-us/library/ms229043.aspx
* http://msdn2.microsoft.com/en-us/library/ms229045.aspx

--- from coding standards on MSDN ---
Do not use abbreviations or contractions as parts of identifier names.
For example, use OnButtonClick rather than OnBtnClick.
------

In addition we stay way from Hungarian notation because I encourage my
developers to take a more object oriented approach to their naming by
naming things by functional group names. Such as

LoginName
LoginPassword
LoginGoToLocati onList
LoginSendButton

Instead of the Hungarian way which scatters the names all over the
list like:

txtName
txtPassword
ddlLocation
btnSend

In addition another benefit of not using Hungarian is the ability to
be more flexible and agile when coding.

If you decide all Lists are going to end with the postfix "List" for
drop down, combo boxes, and everything in between. It is a lot easier
to adjust the interface if somebody wants to go from a combo box to a
drop down list.

SomethingList

However if you use Hungarian you have to rename all your variables to
go from a drop down list to a combo box, if you still want to maintain
your naming convention, which is the original reason why you are
having this meeting.

ddlSomething
cmbSomething

Hope this helps.

Mar 19 '07 #4
Hungarian notation is old fashioned.
It was useful in the pre- .NET days but nowadays there are far too many
object types for Hungarian notation to still be very useful.
If you use it at all it should mostly be limited to prefixing standard
controls only.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Grey Squirrel" <ak*******@gmai l.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
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!
Mar 19 '07 #5
On Mar 19, 9:34 am, "Grey Squirrel" <akataw...@gmai l.comwrote:
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!
VB .NET developer here.

Pre .NET, I used Hungarian. However, I avoid it like the plague now. I
use camel case for variable names; Pascal case for everything else.

As Steve Orr pointed out, the problem is that you have far too many
types out there. You'd end up with potentially hundreds or thousands
of abbreviations. Who could possibly remember them all?

Besides, it's the compiler's job to ensure that your code is type-
safe. VB.NET does this on the fly. If you're using C#, I believe that
VS.NET 2005 does it on the fly as well. (Someone correct me if I'm
wrong.)

The whole point of Hungarian notation was to ensure that the variables
on two sides of an operator were of the same type. .NET languages are
inherently strongly typed. It's required by the CTS. It's one of the
reasons that the use of Hungarian is actively discouraged by
Microsoft.

Don't waste your time adopting Hungarian. It's a relic of the past,
and won't tell you anything that the compiler isn't already telling
you.

Mike

Mar 19 '07 #6
I've written up a fairly thorough answer to your question here:

http://SteveOrr.net/faq/HungarianNotation.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Grey Squirrel" <ak*******@gmai l.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
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!
Mar 21 '07 #7

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

Similar topics

28
10430
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: MyClass variable: iMyInteger
19
1763
by: | last post by:
Just seeking some advice (or solace)... Am I the only who's having trouble letting go of notation? Having extensive experience in C++ years ago (both before I jumped into VB3 in college and at various times during my VB career), I welcomed the "richly-typed" .NET framework. But, after almost *two years* of "giving it a chance," I still insist that using notation for the "common" (mostly value-types) types (string, integer, boolean, etc.)...
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:
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!
14
1551
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 little 3-character prefixes. I'm fine with EmployeeFirstNameLabel instead of lblEmployeeFirstName, 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...
18
4251
by: dom.k.black | last post by:
I am looking at starting a new piece of work for a company who are heavily into hungarian notation for C coding. Any killer arguments for NOT carrying this terrible practice forward into new C++ code?
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
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.