Did I St-St-Stutter?
-
IMHO Hungarian notation used to make sense in ancient times when IDEs didn't provide information about the type and you had to navigate through code to find it. Don't get me wrong, I used it as well. A real problem with Hungarian notation begins when you decide to change the type and forget that the name has to be changed as well. How many times have you worked with code of someone who actually forgot to change the name? It's not only misleading, it's irritating. Personally I use these naming conventions not only in my .Net code but in C/C++ as well.
modified on Tuesday, July 26, 2011 2:33 AM
Did you see the section on "Controls on Forms"? Looks like a mild form of Hungarian notation. Instead of naming after the particular control type, looks like the recommendation on that page is to name it after its function (e.g., field, label, command). That solves the issue of changing control type, at least for the most part (so if you change your control from a textbox to a RichTextBox, "BiographyField" is still a valid name). I like that.
Martin Fowler wrote:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
-
Did you see the section on "Controls on Forms"? Looks like a mild form of Hungarian notation. Instead of naming after the particular control type, looks like the recommendation on that page is to name it after its function (e.g., field, label, command). That solves the issue of changing control type, at least for the most part (so if you change your control from a textbox to a RichTextBox, "BiographyField" is still a valid name). I like that.
Martin Fowler wrote:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
-
<asp:PlaceHolder runat="server" ID="phPhone">
(Code to Insert Phone Number)
</asp:PlaceHolder>I still use hungarian notation when naming ASP.NET server controls. I hope my coworkers don't think I have a speech im... imp... imped... a speech problem.
Martin Fowler wrote:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
This is your phone. This is your phPhone on acid.
"I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson My comedy.
-
Hungarian notation is an abomination before God.
Software Zen:
delete this;
Good thing I'm an atheist then. :laugh:
-- Kein Mitleid Für Die Mehrheit
-
Good thing I'm an atheist then. :laugh:
-- Kein Mitleid Für Die Mehrheit
Hungarian notation is an abomination before all-sentient-life-regardless-of-personal-belief-system. FTFY.
Software Zen:
delete this;
-
Performance is a feature. You shouldn't sacrifice performance (where it is actually important) for better readability. However, you should still strive to make the code as understandable (and readable) as possible.
Martin Fowler wrote:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Exactly! It's very truly said! :thumbsup: