Jakob Braeuchi wrote:
yes, the m_fields were introduced by me.
the company i work for uses this standard and when i first saw it, i found it totally useless. i'm an old smalltalker and was used to access all instVars by getters and setters, so i didn't care about the name of the instVar itself. in java code i found that most instVars were accessed directly, and sometimes even temVars or parameters had the same name as the instVars. so after all the m_ prefix looked quite useful, because it let's me spot the access to instVars quickly.

You are right, I didn't think about the encapsulation issue.

However, I think it is more of a Java de-facto standard to name getters
and setters according to the members name. At least with IntelliJ IDEA
refactoring tools you can then rename getters/setters and all callers of
those automagically when you rename a memeber variable (which is not
possible for "protected String m_foo;" vs "public String getFoo();").

But I don't have a huge issue with "m_" prefixes for members and will
happily use whatever the majority decides on. :-)

Just as long as we decide which one to use in the naming standard.

Cheers,
 Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to