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

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 4035
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*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.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*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.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...@gmail.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
LoginGoToLocationList
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*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.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...@gmail.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*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.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
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: ...
19
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...
66
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...
24
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: ...
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? ...
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...
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...
18
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++...
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: 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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
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.