定义变量时你是否会刻意的对齐代码
你喜欢这样:
int a;
double b;
char *pStr;
std::vector<int> arrInt;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
还是这样:
int a;
double b;
float c;
float d;
char *pStr;
std::vector<int> arr;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
我喜欢第一种,只是当某个类型过长时,其他则可以不和他看齐,例如这样:
int a;
double b;
float c;
float d;
char *pStr;
std::vector<int> arrInt;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
各位呢
[解决办法]
你不说,我还真没注意。
应该类似第二种吧。
[解决办法]
对齐能对齐的所有元素!
- C/C++ code
int a ;double b ;char * pStr;std::vector<int > arrInt;std::vector<std::string> arrStr;std:: map<std::string> mapStr;
[解决办法]
不会
[解决办法]
在看到2L之后,我以为LZ是来消遣别人的,害我看了好久都看不出两种格式的不同。
- C/C++ code
int a;double b;float c;float d;char *pStr;std::vector<int> arrInt;std::vector<std::string> arrStr;std::map<std::string> mapStr;
[解决办法]
[解决办法]
个人习惯不同,没有太大影响
[解决办法]
我也喜欢第一种
[解决办法]
我喜欢第一种
[解决办法]
理解你,我写的编程规范里直接就是这么要求的,做为评定代码是否合格的标准之一。
[解决办法]
看的头西晕的。。
[解决办法]
+1
[解决办法]
我会把注释对齐。。。。。
[解决办法]
[解决办法]
个人认为都挺好的.
[解决办法]
类的成员 我会对齐
函数中的变量 不会
[解决办法]
尼玛啊,我没洁癖的.
[解决办法]
各有所好
[解决办法]
充长见识, 学习来了!