国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Ruby > 正文

Ruby編程中的命名風格指南

2020-10-29 19:37:40
字體:
來源:轉載
供稿:網友

用英語命名標識符。

  

 # 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(

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