Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order methods by abstraction grouped by use #10

Open
patricksrobertson opened this issue Mar 28, 2012 · 2 comments
Open

Order methods by abstraction grouped by use #10

patricksrobertson opened this issue Mar 28, 2012 · 2 comments

Comments

@patricksrobertson
Copy link
Contributor

Methods should be organized in a class/module in the following way:

Class Documenturion
  def high_level_method
    a_lower_level_method @instance
  end

  def a_lower_level_method(parameter)
    #roar
  end

  def second_high_level_method
    another_low_level_method @instance
  end

  def another_low_level_method(parameter)
    #roar again
  end
end

I think when there isn't a clear level of abstraction present in a class, an ad-hoc style such as alphabetical is quite acceptable.

@wm
Copy link
Member

wm commented Mar 28, 2012

👍

@jgn
Copy link
Member

jgn commented Mar 28, 2012

What a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants