How I use Hungarian notation?

Well, this post is not my attempt to start millionth flae war about variable naming conventions. It is my explanation how I use Hungarian notation and why. By the way I am not dedicated fan of any convention, so starting flaming here has no point. So let's see why and how I use Hungarian notation.

 

NB! This blog is moved to gunnarpeipman.com

Click here to go to article

3 Comments

  • I use Hungarian notation on all my controls as well, but no where else.

  • I try to put some semantic information into the name, so if I need a label that will contain "username :" I will call it UsernameLabel.

    The "Label" suffix does not imply the type, the control could be anything (usualy its a Literal or a Label)


    Side note: as far as I know, the simple prefixes like "str" and "i" are not really hungarian notation.


  • We don't use Hungarian notation in .NET code, as proposed by Microsoft's guidelines for class library developers.

    Concerning control fields we see it as follows: A TextBox providing the first name (e.g., of a customer) becomes "firstNameTextBox".

    As I've seen, some others utilize Hungarian solely for those control fields, but not for other fields or variables, which might be OK as well.

Comments have been disabled for this content.