4 5756
I use the "m_" just because they are private, you don't see it when you use
my class, don't you? And I did that because I need a clue to make the
difference between a parameter and private variable, and I don't like to use
"this" all the time to access the private data.
Best regards,
Relu
"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:76**********************************@microsof t.com... I've notice that some Microsoft's code, uses the "m_" convention to refer
to private member fields. Check this : http://support.microsoft.com/default...b;EN-US;326080 http://support.microsoft.com/default...b;EN-US;326176 http://support.microsoft.com/default...b;EN-US;326145
I read the dotnet guidelines, and I don't recall the "m_" convention was accepted.
Is Microsoft violating its own code rules ?
Regards,
just use _ as the m prefix is a waste of time, ofcourse its a member if
its in the type.
"Georgescu Aurelian" <re**@itprovision.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl... I use the "m_" just because they are private, you don't see it when you
use my class, don't you? And I did that because I need a clue to make the difference between a parameter and private variable, and I don't like to
use "this" all the time to access the private data.
Best regards, Relu
"Craig Kenisston" <cr************@hotmail.com> wrote in message news:76**********************************@microsof t.com... I've notice that some Microsoft's code, uses the "m_" convention to
refer to private member fields. Check this : http://support.microsoft.com/default...b;EN-US;326080 http://support.microsoft.com/default...b;EN-US;326176 http://support.microsoft.com/default...b;EN-US;326145
I read the dotnet guidelines, and I don't recall the "m_" convention was accepted.
Is Microsoft violating its own code rules ?
Regards,
I think you are right, they are inconsistent:
"Do not apply a prefix to field names or static field names." - bottom of http://tinyurl.com/519n
Personally I think the readability gained by prefixes-on-fields is worth the
pain (if you can call typing "m_" pain). Some people put "this." on front
of all members usages, but the compiler won't tell you if you forget one.
After trying "_" for a while, I still prefer "m_", cause it stands out
better. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: BJörn Lindqvist |
last post by:
I think it would be cool if you could refer to instance variables
without prefixing with "self." I know noone else thinks like me so
Python will never be changed, but maybe you can already do it...
|
by: Fernando M. |
last post by:
Hi,
i was just wondering about the need to put "self" as the first
parameter in every method a class has because, if it's always needed,
why the obligation to write it? couldn't it be implicit?...
|
by: Vinod I |
last post by:
Hi Team,
I just want to know, wat is the relevance /or benefit of using "_" before a
variable.
i.e., if I use a variable as "_MyVariable", wat benefit I am going to
achieve than just using...
|
by: Anders Borum |
last post by:
Hello!
I'm wondering what the recommendations are for using the "this" keyword?
The problem is that I really like to use the "this" keyword, but it tends to
make the code more verbose (which...
|
by: Agnes |
last post by:
For my own practices.
I like to put "Me".
e.g IF Me.txtInvoice.textlength = 0 ....... etc
Me.txt.....etc
However, Is there any difference (without Me) ??
Thanks
|
by: J.M. |
last post by:
I have a question concerning inheritance: can an abstract (parent) class
have an abstract object? I would like to make a concrete child inherit from
this class by inheriting from this object. Let...
|
by: Dave |
last post by:
I'm never quite sure whether to use "this." or not when referring to fields
or properties in the same class. It obviously works just fine without it
but sometimes I wonder if using this....
|
by: Internet User |
last post by:
I see m_ prefixed in front of variable names all the time in code for
classes. Is this a coding convention and if so how does one describe the
type of variables it is used with?
Thanks in...
|
by: prix prad |
last post by:
Hi All,
I encountered the above error when I tried to expand a macro
as follows:
#define EXPAND(array) int M_ ## array
The problem occurs when we have 'array' itself as a macro:
say...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |