Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net - Better way of naming control - Hungarian Notation or Full Notation such as lbl or Label

Tags:

.net

In the old days, we name controls as lblFirstName, txtFirstName.

I'm seeing more and more full names like FirstNameLabel, FirstNameTextBox. Obviously, it doesn't make any different.

My question is whether Microsoft officially recommended using full name like FirstNameLabel.

If this question has been asked, please forgive me.

like image 793
Win Avatar asked Dec 01 '22 08:12

Win


1 Answers

For UI Only objects such as a textbox or label; the convention of notating what sort of windows control it is is valid, and since it's been a tradition in .NET, I see no reason to change it. If your company has a different standard, use that standard; but for UI controls, the convention I've seen has always been to use the three letter prefix (I hesitate to call it hungarian notation, but that's the closest thing it resembles).

like image 52
George Stocker Avatar answered Dec 22 '22 08:12

George Stocker