Questions tagged [hungarian-notation]

Hungarian notation is a language-independent naming convention in which an identifier's prefix indicates its type. Examples include iCustomerId, sFirstName, etc.

Hungarian Notation is a language-independent naming convention in which an identifier's prefix contains meta information about the identifier. It could be used for type, to denote usage and/or for readability or maintainability.

Wikipedia Article

Joel Spolsky's Article

Examples

59 questions
9
votes
1 answer

Python Generator Function Names -- is a prefix helpful?

Most functions are easy to name. Generally, a function name is based on what it does or the type of result it produces. In the case of a generator function, however, the result could be a iterable over some other type. def sometype( iterable ): …
S.Lott
  • 384,516
  • 81
  • 508
  • 779
8
votes
20 answers

Do you follow the naming convention of the original programmer?

If you take over a project from someone to do simple updates do you follow their naming convention? I just received a project where the previous programmer used Hungarian Notation everywhere. Our core product has a naming standard, but we've had a…
wonderchook
  • 1,200
  • 10
  • 18
6
votes
2 answers

Get rid of Hungarian notation in C# code in automated manner?

I have a large codebase that uses Systems Hungarian for most variable names, which basically means I have lots of objQueue's, objCommon's, dtDataSet's et cetera. Is there any way to convert most of them? Especially, I want to get rid of…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
6
votes
4 answers

Hungarian in VBA okay?

I don't use hungarian (str, int) prefixes in .Net, but I still find it useful in VBA, where it is more difficult to see types. Is this bad? Unnecessary? Maybe I'm missing something. I'd really appreciate any feedback. I've been wondering for a…
KennerL90
  • 63
  • 4
6
votes
4 answers

Where can I find a cheat sheet for hungarian notation?

I'm working on a legacy COM C++ project that makes use of system hungarian notation. Because it's maintenance of legacy code, the convention is to code in the original style it was written in - our newer code isn't coded this way. So I'm not…
MauriceL
  • 445
  • 5
  • 13
5
votes
1 answer

Hungarian notation in Intellij IDEA

I have to do some maintenance on legacy code that uses Hungarian notation (and Systems Hungarian at that). Unfortunately, it's not practical for me to just clean it all out of the codebase. Local Eclipse users claim that Eclipse can be configured so…
David Moles
  • 48,006
  • 27
  • 136
  • 235
5
votes
6 answers

Hungarian notation in VB.NET?

Our programming teacher taught us to use the Hungarian notation (e.g. intMyInteger, strMyString,...) while programming. But I have heard somewhere this isn't actually used in the professional world. Is this true? Edit: I just found out this is…
Simon Verbeke
  • 2,905
  • 8
  • 36
  • 55
5
votes
3 answers

An interesting detail about variable name

I have read tutorials all over the web with different kinds of tutorials specified on game (however, this turns out to be pretty general). Are there any reasons to why many developers name their variables like: mContext For me it is default to just…
Curtain
  • 1,972
  • 3
  • 30
  • 51
5
votes
20 answers

Best way to get rid of hungarian notation?

Let's say you've inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in that class, there's copious use of Hungarian notation (the bad kind). Would you…
Robert S.
  • 25,266
  • 14
  • 84
  • 116
4
votes
1 answer

Tool to validate naming style in VB.NET following Hungarian notation

I'm maintaining a legacy ASP.NET website written in VB.NET. Our customers force us to use Hungarian notation for declaring variables and such: E.g: Dim sSomeString as String Dim oSomeObject as xxxClass Is there any tool like FxCop, StyleCop,…
4
votes
4 answers

How do you keep track of exception safety guarantees offered by each function

When writing exception safe code, it is necessary to consider the exception safety guarantee (none, basic, strong or no-throw) of all the functions called. Since the compiler offers no help, I was thinking that a function naming convention might be…
4
votes
2 answers

Do you use Hungarian notation for control names?

I totally agree that we should not use Hungarian Notation to name variables. But it seems that Hungarian Notation is still useful to name controls (especially Winform controls). Consider these: GridView grvUsers TextBox txtPassword etc... I really…
Delta76
  • 13,931
  • 30
  • 95
  • 128
4
votes
1 answer

Hungarian Notation in Android Naming Conventions

So, I'm not a huge fan of Hungarian Notation. Today an Android Developer from my company dropped this link to the official advices re Android development, and I was surprised by the fact, that they find it useful to start all field names with m. I…
John Doe
  • 9,414
  • 13
  • 50
  • 69
3
votes
5 answers

Should I use hungarian apps notation in C#?

I know this question has been asked around a bit, and by the looks of it, there isn't a clear yes or no answer to this question, but still, I'm a little confused about something. Usually when I program, I follow a few rules about prefixes: m_ in…
NomenNescio
  • 2,899
  • 8
  • 44
  • 82
3
votes
2 answers

Getters and Setters in Eclipse for Hungarian Style Members

The project I'm working on dictates hungarian notation for class member variables. Example: String m_foo; Is it possible to make Eclipse strip the hungarian prefix when generating getters and setters? I'm using Helios and it suggests (not…
user362178
  • 818
  • 6
  • 10