網頁

2014年3月2日 星期日

Naming Rule of Program

Last Update: 2014/03/03 14:12+08
Type: Note (未完)



大寫=Upper, 小寫=Lower
此篇未完成


C++
  • Namespaces are expected to be all lower case, this is borrowed form Java and C++
  • Functions within namespaces are expected to be lower case, with words connected by underscores. This is borrowed from traditional C programming conventions, as well as traditional Slick-C conventions. Couldn't borrow ideas from Java here...
  • Class names are mixed case and should start with an upper case letter. This is borrowed from Java and C#
  • Function names within classes are mixed case and should start out with a lower case letter. Again, borrowed from Java style
  • Class member variables should start with "m_" and can be mixed case
  • Static class member variables should start with "s_" and can be mixed case
  • Constants, such as enumerations, should be all upper case



Java
  • package(類似namespace) 全部字母為 Lower
  • function 第一個單字(word)的第一個字母為 Lower, 而後的單字開頭為 Upper
  • class 第一個字母為 Upper



VC++(MS)
  • namespace 第一個字母為 Upper
  • function ?
  • class 第一個字母為 Upper



C#(MS)
  • namespace 第一個字母為 Upper
  • function 第一個字母為 Upper, 而後的單字開頭為 Upper
  • class 第一個字母為 Upper



沒有留言:

張貼留言