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
3
votes
8 answers

Naming guidelines with C#

I have this class: class DoSomething { private int timesDone; ... } Which is the right way to named variable 'timesDone'? Sometimes I see named as m_timesDone. Is this correct? Where I can find information about naming guidelines? Thank…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
2
votes
4 answers

Naming advice for replacing/avoiding hungarian notation in UI?

I've stopped using Hungarian notation everywhere except in the UI, where often I have a username label, a user name text box, a user name local variable, a required field validator, a user name property and method parameter so on, often all in the…
MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
2
votes
0 answers

What's the appropriate Hungarian Notation prefix for a PHP stdClass?

If there is one, that is. (Such as nInteger, chChar, cCount or rgArray.)
tessr
  • 628
  • 1
  • 6
  • 13
2
votes
1 answer

How can I see the type of a variable in the MS Office VBA editor?

I no longer use Hungarian notation when coding VBA but I sometimes run into situations where the type of a given variable isn't obvious. For example, take a variable with a name of dataRow. It could be a row number with a Long variable type. It…
ChrisB
  • 3,024
  • 5
  • 35
  • 61
2
votes
1 answer

FreeRTOS Hungarian Notation

I'm a complete newbie in RTOS and C programming, and I'm still getting used to the C good practices yet. So I opened a project which uses FreeRTOS, and I notice that the OS files use the Hungarian Notation. I know the notation a little, but faced…
ulissesBR
  • 93
  • 11
2
votes
1 answer

What's the correct alternative to hungarian notation for text box and corresponding label?

In spite of the countless questions asked on StackOverflow and the countless articles I've researched online, I cannot find a clear answer on how to avoid using hungarian notation for a text box and it's corresponding label. Let's say I name a text…
Clarus Dignus
  • 3,847
  • 3
  • 31
  • 57
2
votes
1 answer

How to notate nested arrays or structs or classes the Hungarian way?

I have an array which contains another array Would I notate it this way? pseudocode: rgrgTest = newArray(2) What if the array contains i.e. a struct? pseudocode: rggrTest = newArray(2).newStruct() Or this way i.e. if I want to classify the data…
mrt181
  • 5,080
  • 8
  • 66
  • 86
1
vote
0 answers

old-school Hungarian Notation "mz" prefix

Every so often, I need to dig into older APIs, and I keep running across functions with an "mz" prefix for API calls. (Example, functions like mzListDocuments() I'm just curious what this "mz" stands for in this context. I'm aware of old Hungarian…
David
  • 72,686
  • 18
  • 132
  • 173
1
vote
2 answers

Is There Any Way To Make More Custom Naming Style For ReSharper 6?

My project have a coding convention that: For local variables (inside methods): Use the format [prefix][variable name] [Prefix] will be the first character of the data type if variables are of primitive type such as Integer, Byte,…
dat1991
  • 11
  • 3
1
vote
1 answer

Is there any performance decrease in java, for extending classes for "no" reason?

I have a Vector3i class that is useful in a lot of situations, but I've found myself extending it to use the type system to prevent bugs. For example, I might have an "ego-centric" vector3i that is local to an object in the world, and a world…
Ryan Leach
  • 4,262
  • 5
  • 34
  • 71
1
vote
4 answers

mysql naming convention

I have generally always used some sort of Hungarian Notation for my field names in my tables e.g. #Table Users u_id, u_name, u_email etc... #Posts p_id, p_u_id, p_title, p_content etc... But I have recently been told that this isn't best practice.…
Lizard
  • 43,732
  • 39
  • 106
  • 167
1
vote
3 answers

How to model a duration in an object oriented way?

I'm dealing with different APIs that use Integers to model duration. Only they can't seem to agree on the units. Sometimes it's seconds and sometimes it's milliseconds. So far the best way to avoid errors I've been able to find, is to use Hungarian…
KaptajnKold
  • 10,638
  • 10
  • 41
  • 56
1
vote
1 answer

Hungarian naming convention: mixed type

I'm using the HNC in this way for variables in PHP: $p_nId. p stands for parameter, so the scope of the variable, n for the type (though PHP is loosely typed, it gives some structure), so numeral here. Is there a type prefix in the HNC for a mixed…
user1544337
1
vote
3 answers

Excel-VBA: Variable Names, Hungarian Notation and Variable Naming Best Practices

When I program in Excel-VBA I use Hungarian notation. Worksheet variables start with ws, workbook variables start wb, etc. When I use integers, I always use longs, because in the past I have exceeded the maximum value of an integer, and it takes a…
Curt
  • 1,214
  • 6
  • 16
  • 21
1
vote
1 answer

How does Visual Assist X rename symbol work?

I want to remove the Hungarian Notation from a gigantic piece of code,but I'm not sure how the addon handles replaces.I mean - if I have: void DoNothing(int *pNothing) { pNothing = 0; }; And I click on 'pNothing' and rename it to 'nothing' wiht the…