比如说这道题, 其中 Judge 系统给默认定义了如下 struct ListNode 类型.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* removeElements(struct ListNode* head, int val) {
}
作为一个坚守下划线命名风格的 c 程序员, 我是一定要写成下面这样的:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
#define remove_elements removeElements
typedef struct ListNode list_node;
list_node* remove_elements(list_node* head, int val) {
}
虽然好像变量名字长点的话确实没有驼峰式好看....
1
jmc891205 2016 年 4 月 9 日
哈哈 这样不是还有两个驼峰式的
强迫症是病啊大兄弟! |
2
Vernsu 2016 年 4 月 9 日
注释掉的也是驼峰啊
|
3
KiriGiri 2016 年 4 月 9 日
不喜欢下划线,会弄的名字很长,而且下划线在右上角,用手按过去很麻烦。
|
4
mantianyu OP |
5
SoloCompany 2016 年 4 月 10 日 via iPhone
大小写敏感的系统搞什么鬼下划线
只有数据库设计这些为了能适应大小写不区分的系统的才会考虑使用下划线 |
6
dxwwym 2016 年 4 月 10 日 via iPhone
驼峰第一个字母也大写?
|
7
xpol 2016 年 4 月 10 日 via Android
@dxwwym Wikipedia:The first letter of a camel case compound word may or may not be capitalized, and there is no real consensus on whether the term camel case generally implies an uppercase or lowercase first letter.[2][3][4] For clarity, this article calls the two alternatives upper camel case and lower camel case. Some people and organizations use the term camel case only for lower camel case.
|
9
allan888 2016 年 4 月 10 日
|
10
allan888 2016 年 4 月 10 日
@allan888 话说因为我没刷完,所以 fork 我的我都好心的不定期给发了 pull request 。。。
然而一个接受 pr 的都没有!! |
12
SuperFashi 2016 年 4 月 10 日 via Android
奇怪, C/C++难道不是标准驼峰吗,反正我是一直驼峰 hhhh
|