UWE-Ruby / RubyCoreLanguage2013

Ruby - The Core Language, Bellevue 2013

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RubyCoreLanguage2013

Ruby - The Core Language, Bellevue 2013

Class Tools

Code Standards

  • Informed by Ruby Style Guide
  • Class requirements
    • Spacing
      • 2 spaces per indent - no tabs
      • spaces in methods only if required to separate ideas
      • one space between methods
    • Case
      • snake_case variables
      • CamelCase classes
      • SCREAMING_SNAKE_CASE for constants
    • Methods
      • named what it returns not what it does (names, not get_names)
      • predicate methods end in a question mark (empty?)
      • dangerous methods end in an exclamation mark, where non-dangerous version exists (uniq and uniq!)
      • rarely more than 5 or 10 LOC
    • omit parenthesis, usually
    • prefer {...} over do...end for single line blocks
    • avoid perl style special variables ($0, $`, etc)

About

Ruby - The Core Language, Bellevue 2013


Languages

Language:Ruby 100.0%