用英語命名標識符。
# 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( 主站蜘蛛池模板: 青冈县| 鄂伦春自治旗| 教育| 远安县| 罗甸县| 成安县| 娱乐| 县级市| 蕉岭县| 延长县| 滨海县| 哈密市| 方正县| 嘉义县| 拉孜县| 铜山县| 潍坊市| 额敏县| 汝城县| 滨州市| 安多县| 榆社县| 乾安县| 修文县| 永寿县| 塔河县| 吉林市| 随州市| 百色市| 九龙城区| 拜城县| 印江| 夏津县| 绥江县| 大宁县| 云安县| 德昌县| 广州市| 苍溪县| 石柱| 平安县|