成员变量命名惯例 [英] Member Variables Naming Convention

查看:160
本文介绍了成员变量命名惯例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道大多数人在课堂上使用什么命名约定

变量。


下划线,m_前缀,驼峰大小写,大写等等?


有哪种款式最受欢迎?


感谢任何评论。


-

Jonathan Wood

SoftCircuits编程
http://www.softcircuits.com

I was just wondering what naming convention most of you use for class
variables.

Underscore, "m_" prefix, camel case, capitalized, etc?

Has one style emerged as the most popular?

Thanks for any comments.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

推荐答案

" Jonathan Wood" < jw *** @ softcircuits.com写信息

新闻:%2 **************** @ TK2MSFTNGP02.phx.gbl ...
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...

>我只是想知道大多数人使用哪种命名约定来用于类
变量。


下划线, " M_"前缀,驼峰大小写,大写等等?


有哪种款式最受欢迎?
>I was just wondering what naming convention most of you use for class
variables.

Underscore, "m_" prefix, camel case, capitalized, etc?

Has one style emerged as the most popular?



我认为这有两个主要的思想流派。首先是用_前缀

。第二个是让它成为驼峰的情况。我更喜欢第一个

虽然第二个似乎是MS标准。


Michael

I think there are 2 main schools of thought on this. This first is to prefix
it with _. The second is to just make it camel case. I prefer the first
although the second appears to be the MS standard.

Michael


嗨Jonathan,

这里是微软命名约定指南的链接:
http://msdn.microsoft.com/library/de...guidelines.asp


我遵循这些。


马克。

-
http://www.markdawson.org

" Jonathan Wood"写道:
Hi Jonathan,
here is a link to the Microsoft guidelines for naming conventions:
http://msdn.microsoft.com/library/de...guidelines.asp

I follow these.

Mark.
--
http://www.markdawson.org
"Jonathan Wood" wrote:

我只是想知道你们大多数人使用什么命名约定

变量。


下划线,m_前缀,驼峰大小写,大写等等?


有哪种款式最受欢迎?


感谢任何评论。


-

Jonathan Wood

SoftCircuits编程
http://www.softcircuits.com




Jonathan Wood写道:

Jonathan Wood wrote:

我只是想知道你们大多数人使用什么命名约定

变量。


下划线,m_前缀,驼峰大小写,大写等等?


有哪种款式最受欢迎?


感谢任何评论。


-

Jonathan Wood

SoftCircuits编程
http://www.softcircuits.com



骆驼案。


class TheClass

{

private int theInt;


public int TheInt

{

blah,blah,blah

}

}


-

Tom Shelton

Camel case.

class TheClass
{
private int theInt;

public int TheInt
{
blah, blah, blah
}
}

--
Tom Shelton


这篇关于成员变量命名惯例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆