rubyist icon indicating copy to clipboard operation
rubyist copied to clipboard

conventions for private/public/protected

Open riffraff opened this issue 14 years ago • 0 comments

I realized these are missing, both as editor conventions (e.g., if base indent is 2, indent "private" keyword by 1 is what I use) and coding style. Off the top of my head

  • should we use _foo for private methods ? I always thought it makes sense (way more then private does in ruby), but I seldom see it used

  • should we use private/protected methods at all?

  • when should we use private with or without arguments?

    private def foo()... end;

    def foo.... end private :foo

riffraff avatar Sep 13 '11 14:09 riffraff