Skip to content

Instantly share code, notes, and snippets.

@marlomajor
Created March 26, 2016 20:05
Show Gist options
  • Save marlomajor/23b539e3b199dac84bad to your computer and use it in GitHub Desktop.
Save marlomajor/23b539e3b199dac84bad to your computer and use it in GitHub Desktop.
Sandi Metz Rules for Developers

Summary

Sandi Metz rules were all interesting and clearly demonstrated that simple is usually better. The rules were that classes should have no more than 100 LOC, methods should have no more than 5LOC (including if/else statements), a controller should instantiat only one method, and that methods should have no more than four parameters passed into the method.

Hardest Rules to Follow

The hardest of Sandi's rules to follow will be keeping methods to <= 5 LOC and instantiating only one object in a controller. My methods are typically not refactored well and extremely long, simply because I'm trying to get my thoughts on the page and rarely have time to refactor. Concerning the one object controller, its just not something I'm used to doing. But getting used to instantiating only one object feels as though its something I can eventually get used to. The hardest rule for Thoughtbot to follow (the only rule they ended up reverting to "Rule 0" for was the four method arguments rule. In rail, form_for and link_to can often take more than those arguments. Its understandable why they disregarded this rule int their program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment