2 Star 2 Fork 0

句龙胤 / V-Language.Librarys

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Naming Conventions(Chinese).txt 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
句龙胤 提交于 2015-07-27 04:14 . 2nd reconstruction
The Naming Convertions of V Lanuage Tools Project
================================================================
1.文件
全部使用小写,使用-连接单词,不能有_。
main.cpp
symbol-table.cpp
2.名称空间
全部使用小写,不能有_。
namespace a{namespace b{}}
3.函数(普通函数/类方法)
单词首字母大写,可以由动词和名词组成,不能有_。
GetObject()
Show()
Name()
函数参数的命名规范和局部变量相同。
4.局部变量
全部使用小写,可以有_,避免动词。
name
object_nums
只能使用已经成为行业习惯的缩写,只能在以下地方使用缩写。
循环
for (int i = 0, int j = 0; ...)
小或非常清晰的函数
string StringAppendChar(const string& s, char c){return s+c;}
5.类型
5.1 结构
单词首字母大写,不能有动词,不能有_。
struct Point {int x, int y}
struct FastVector {}
5.2 枚举
单词首字母大写,由名词组成,不能有_。
enum Color {}
enum CarType {}
5.3 类
单词首字母大写,避免动词,不能有_。
class Table {}
class SlowCodec {}
类成员变量有m_前缀,全部使用小写,可以有_,避免动词。
m_size
m_names
1
https://gitee.com/nneolc/V-Language.Librarys.git
git@gitee.com:nneolc/V-Language.Librarys.git
nneolc
V-Language.Librarys
V-Language.Librarys
master

搜索帮助