Hi Michael,
What's the most interesting that the widely-accepted standardization is tuned a little bit to
suite company best practice.
I think tuning usually occurs because people are used to a certain way of doing things and don't
like to adopt a new standard. The "_" notation is just half-way between "m_" and the standardized,
non-prefix notation (is "_" considered hungarian notation?), so it seems that some people gave in a
little, tuning for comfort but not standards.
I, myself, found that adopting some of the standards for managed programming was annoying at first,
but it was worth it. My code is easier to read now and I have to worry less about other programmers
messing up my code when it flows from organization to organization, given that they too abide by the
standards. In the past, it's always been annoying when my library code was modified and formatting
of the { }, tabs, notation, naming conventions and document structure are completely messed up by
someone doing what they felt was best. Mixing personal preference with standards results in a big
mess.
Of course, in an organization that has internally standardized the "_" notation it's less of a
problem. But new hires must learn the techniques and deployed code may be seen by different
organizations in the future, so its use is not completely isolated.
I've met the number of cases where "_" was used widely in the big companies and it gives more pros
than cons
I acknowledge Kevin's concern with the ambiguity between parameters and fields using the
standardized naming convention, however, I think that qualifying fields looks much better anyway:
public ClassConstructor(int firstNumber, int secondNumber)
{
_FirstNumber = firstNumber;
this.secondNumber = secondNumber;
}
What does "_" provide over the standard, excluding the above?