News for hackers. Stuff that matters.
Re:Best Practices of Variable & Method Naming by huggyface on Saturday February 25, 2012 @04:02PM (#3633844)
You should be able to do a global search

I would offer that you should have tools that are smarter about your code, with a contextual awareness of what things are and how they are used. Many coding purported "best-practices" are based upon such a tool deficiency.

Let me give one example that is a serious peeve of mine -- C# allows you to define region. I have to interact with code that uses regions to define accessibility or type of members.

#region private members

#endregion

This was communicated as a "best practice" because it allows you to hide/show appropriate parts of the code.

Yet the primary tool -- Visual Studio -- has fantastic tools for exactly that use. Tools that don't muddy up the code with unvalidated, quickly out of date metadata (e.g. nothing stops me from putting a public in there).

This holds true for many, many coding conventions. We discarded hungarian notation for the same reason that many of these other naming guidelines are of dubious merit.

There are no comments on this comment yet.