免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: albcamus
打印 上一主题 下一主题

C程序代码风格 [复制链接]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
31 [报告]
发表于 2005-09-21 00:29 |只看该作者

C程序代码风格

原帖由 "dbcat" 发表:
This document is a bushit!
Why should i write kernel program like that?
Just think about when linus was writing first linux version ,he is just a
college student like u.
Be u not him or u'll be a ..........

呵呵,程序风格是一个永远说不清也道不明的东西。 :wink:

论坛徽章:
0
32 [报告]
发表于 2005-09-21 09:13 |只看该作者

C程序代码风格

原帖由 "dbcat" 发表:
This document is a bushit!
Why should i write kernel program like that?
Just think about when linus was writing first linux version ,he is just a
college student like u.
Be u not him or u'll be a ..........

Coding style is very personal, and I won't _force_ my views on anybody, but this is what goes for anything that I have to be able to maintain, and I'd prefer it for most other things too.  Please at least consider the points made here.
CodingStyle.

论坛徽章:
0
33 [报告]
发表于 2005-09-21 16:39 |只看该作者

C程序代码风格

好,顶

论坛徽章:
0
34 [报告]
发表于 2005-09-21 22:30 |只看该作者

C程序代码风格

Thank you very much.It is worth our appreciation.

论坛徽章:
0
35 [报告]
发表于 2005-09-21 22:38 |只看该作者

C程序代码风格

以前看过,很不错的文章

论坛徽章:
0
36 [报告]
发表于 2005-09-22 08:28 |只看该作者

C程序代码风格

编程风格这种东西嘛,软件个体户看不看都无所谓了,
但如果要搞一个大工程的话,大家最好还是统一一下
步调才好,否则搞出来的东西会是一个丑八怪的。

再说了,很多系统对编程风格的规定都是历史的积累,
遵守了这些规定,实际上也可以在很大程度上减少范
错误的机会,这一点是需要慢慢去体会的。

跟Linux类似,这个东西就是偶的行为准则:
  1. STYLE(9)               FreeBSD Kernel Developer's Manual              STYLE(9)

  2. NAME
  3.      style -- kernel source file style guide

  4. DESCRIPTION
  5.      This file specifies the preferred style for kernel source files in the
  6.      FreeBSD source tree.  It is also a guide for the preferred userland code
  7.      style.  Many of the style rules are implicit in the examples.  Be careful
  8.      to check the examples before assuming that style is silent on an issue.
  9. ......
复制代码

论坛徽章:
0
37 [报告]
发表于 2005-09-22 09:05 |只看该作者

C程序代码风格

我喜欢的风格
文件 $HOME/.indent.pro,

  1. -bad
  2. -bap
  3. -bbb
  4. -bbo
  5. -nbc
  6. -bl
  7. -bli0
  8. -bls
  9. -c33
  10. -cd33
  11. -ncdb
  12. -ncdw
  13. -nce
  14. -cli0
  15. -cp33
  16. -cs
  17. -d0
  18. -nbfda
  19. -di2
  20. -nfc1
  21. -nfca
  22. -hnl
  23. -i4
  24. -ip5
  25. -l70
  26. -lp
  27. -pcs
  28. -nprs
  29. -psl
  30. -saf
  31. -sai
  32. -saw
  33. -nsc
  34. -nsob
  35. -nss
  36. -ts4
  37. -ut
复制代码

遇到看着不爽的代码, 直接帮他 indent 一下.

论坛徽章:
0
38 [报告]
发表于 2006-07-30 21:30 |只看该作者
原帖由 dbcat 于 2005-9-20 23:23 发表
This document is a bushit!
Why should i write kernel program like that?
Just think about when linus was writing first linux version ,he is just a
college student like u.
Be u not him or u'll be ...



傻婆,都吾知你乱讲咩~~   正JERK!,一边玩泥沙去

论坛徽章:
0
39 [报告]
发表于 2006-07-31 17:37 |只看该作者
有些部分很赞同!

论坛徽章:
0
40 [报告]
发表于 2006-07-31 21:25 |只看该作者
大好.....= =|||不过这个我好象以前见过...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP