用英語命名標識符。
# bad - identifier using non-ascii characters заплата = 1_000 # bad - identifier is a Bulgarian word, written with Latin letters (instead of Cyrillic) zaplata = 1_000 # good salary = 1_000
使用snake_case的形式給變量和方法命名。
# bad :'some symbol' :SomeSymbol :someSymbol someVar = 5 def someMethod ... end def SomeMethod ... end # good :some_symbol def some_method ... end
Snake case: punctuation is removed and spaces are replaced by single underscores. Normally the letters share the same case (either UPPER_CASE_EMBEDDED_UNDERSCORE or lower_case_embedded_underscore) but the case can be mixed
使用CamelCase( 主站蜘蛛池模板: 饶河县| 高陵县| 侯马市| 堆龙德庆县| 大理市| 应城市| 连平县| 青州市| 崇仁县| 西贡区| 武平县| 闵行区| 阳信县| 临桂县| 民丰县| 安化县| 阿克| 天祝| 松溪县| 虎林市| 沅陵县| 伽师县| 东台市| 连南| 桦南县| 罗定市| 贵德县| 方山县| 登封市| 乐安县| 清新县| 会理县| 绵阳市| 宁乡县| 临高县| 恩施市| 寿阳县| 中牟县| 上饶县| 邹平县| 濉溪县|