Thursday, December 13, 2012

Coding convention as on ruby on rails development

As suggested by ruby on rails framework development:

Follow the Coding Conventions
Rails follows a simple set of coding style conventions.
  • Two spaces, no tabs (for indentation).
  • No trailing whitespace. Blank lines should not have any spaces.
  • Indent after private/protected.
  • Prefer &&/|| over and/or.
  • Prefer class << self over self.method for class methods.
  • Use MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
  • Use a = b and not a=b.
  • Follow the conventions in the source you see used already.
  • The above are guidelines — please use your best judgment in using them.
reference: http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.