Is it worth learning the convention or is it a bane to readability and maintainability?
相关问题
- How can I create a Fluent NHibernate Convention th
- Entity Framework Ignore property by conventions
- Firestore datamodelling articles and categories
- Round brackets or not? Whats the difference?
- Should EventHandler always be used for events?
相关文章
- Should EventHandler always be used for events?
- An interesting detail about variable name
- Which namespace does operator<< (stream) go
- What is build-by-convention in Gradle deep explana
- Are there any benefits to using HtmlTextWriter if
- Named numbers as variables [closed]
- An Ideal Folder Structure for .NET MVC [closed]
- Best way to get rid of hungarian notation?
I don't use a very strict sense of hungarian notation, but I do find myself using it sparing for some common custom objects to help identify them, and also I tend to prefix gui control objects with the type of control that they are. For example, labelFirstName, textFirstName, and buttonSubmit.
Isn't scope more important than type these days, e.g.
With modern techniques of refactoring old code, search and replace of a symbol because you changed its type is tedious, the compiler will catch type changes, but often will not catch incorrect use of scope, sensible naming conventions help here.
Sorry to follow up with a question, but does prefixing interfaces with "I" qualify as hungarian notation? If that is the case, then yes, a lot of people are using it in the real world. If not, ignore this.
I still use Hungarian Notation when it comes to UI elements, where several UI elements are related to a particular object/value, e.g.,
lblFirstName for the label object, txtFirstName for the text box. I definitely can't name them both "FirstName" even if that is the concern/responsibility of both objects.
How do others approach naming UI elements?
I've been working for IBM for the past 6 months and I haven't seen it anywhere (thank god because I hate it.) I see either camelCase or c_style.
What's wrong is mixing standards.
What's right is making sure that everyone does the same thing.