Last active
December 11, 2015 02:09
-
-
Save ethagnawl/4528598 to your computer and use it in GitHub Desktop.
Sandy Metz's OOP Rules (src: http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- classes can be no longer than 100 lines | |
- methods can be no longer than 5 lines | |
- methods cannot accept more than 4 parameters (no gigantic hashes) | |
- controllers cannot instantiate more than 1 object | |
- views cannot know about more than 1 instance variable | |
- views should only send messages to that variable (no Demeter violations) | |
- rules are meant to be broken if by breaking them you produce better code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment