###Sandi Metz's Rules For Developers
Sandi Metz states four rules to maintain good code:
- Classes can be no longer than one hundred lines of code.
- Methods can be no longer than five lines of code.
- Pass no more than four parameters into a method. Hash options are parameters.
- Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object.
In my opinion, rule 2 is the most difficult to follow as a new developer. It is difficult to determine when a long method should be broken into smaller methods, especially if its because of a single if else statement. As I learn more about what good code is, my methods are getting progressively shorter. That being said, access to the breadth of knowledge necessary to know how to efficiently navigate around a problem is still a work in progress. It will be an interesting challenge to keep this rule in mind as I code through module 4 and challenge myself to find better ways to accomplish tasks.