hungarian-notation

Do people use the Hungarian Naming Conventions in the real world?

Is it worth learning the convention or is it a bane to readability and maintainability? ...

Why shouldn't I use "Hungarian Notation"?

I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's available? See also: Do peopl...

Should a project manager enforce coding standards?

Running a team of about 10 developers, mostly working in their own components, is it absolutely needed to force certain coding standards? Example 1 in function names: perform_action vs performAction vs PerformAction Example 2 in Using hungarian notation vs not. The reason I would not like to force coding standards is because each ...

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 refactor the variable names to remove the Hungarian notation, or would you leave them alo...

Good examples of Hungarian Notation?

Please answer with good examples of Hungarian Notation, so we can bring together a collection of these. Edit: I agree that Hungarian for types isn't that necessary, I'm hoping for more specific examples where it increases readability and maintainability, like Joel gives in his article. ...

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 lot of people do custom reporting over the years and do whatever they felt like. I do no...

Are variable prefixes (“Hungarian notation”) really necessary anymore?

Hi, Since C# is strongly typed, do we really need to prefix variables anymore? e.g. iUserAge iCounter strUsername I used to prefix in the past, but going forward I don't see any benefit. ...

textBoxEmployeeName vs employeeNameTextBox

Which naming convention do you use and why? I like to use employeeNameTextBox, because: It seems more natural from an English language perspective. I find it's easier to look up with Intellisense. The convention is similar to the convention used for events (MouseClickEvent, MouseClickEventHandler) and dependency properties (VisiblityP...

What does the 'k' prefix indicate in Apple's APIs?

I've run across many examples of Core Foundation variables named k + someVariableNameHere or k + APILibraryName(2Char) + someVariableNameHere. What does this prefix K indicate? Examples include: kGLPFAStereo kCollectionLockBit kSetDebugOption ...

Good Naming Convention for Anonymous Types

An anonymous type can be thought of as a "Set Once" Object type, whereas an plain old Object or Variant can be set many times. An object or variant tends to be short lived, while an anonymous type is expected to live longer, making it important to communicate intent. What naming convention do you use to communicate intent when using ano...

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 same context. current: lblUser, txtUser, rfvUser, _User, User, user If I do the obvious, ...

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

i have an array wich 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 types of the struct? pseudocode: rggrlstlTest = newArray(2).newStruct(int id, str desc,...

Hungarian Notation

Possible Duplicates: Why shouldnt I use Hungarian Notation? Are variable prefixes ( Hungarian ) really necessary anymore? Do people use the Hungarian Naming Conventions in the real world? I'm sure this subject has been discussed and argued countless times before, but I would like to see what the people here an StackOverflow...

Naming guidelines with C#

Hello! 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 you! ...

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 interested in changing that standard or having a a discussion of our past sins =) Is there an on...

Is hungarian notation applicable to Perl?

In Perl, reference to anything is a simple scalar, and has the $ sigil. It's sometimes hard to say what kind of reference it is. I personally prefix variable names for references with a letter, which indicates ref type. Examples: my $aValues = []; # arrayref my $hValue = {}; # hashref my $oValue = b...

Class names that start with C.

The MFC has all class names that start with C. For example, CFile and CGdiObject. Has anyone seen it used elsewhere? Is there an official naming convention guide from Microsoft that recommends this style? Did the idea originate with MFC or was it some other project? ...

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 notation: durationInMillis, durationInSeconds and so on. It makes me wonder if there's ...

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 while. Thanks everybody. ...

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. Is there a more standard way of doing this? I haven't really liked just using the field...