Skip to content

Instantly share code, notes, and snippets.

@dastinnette
Created March 20, 2016 23:28
Show Gist options
  • Save dastinnette/3b13dddec2bd76b244a6 to your computer and use it in GitHub Desktop.
Save dastinnette/3b13dddec2bd76b244a6 to your computer and use it in GitHub Desktop.
Sandi Metz' Rules For Developers

####Sandi Metz' Rules For Developers

Which of Sandi's rules do you feel like might be the hardest to follow? Why?

Rule 2 - "Methods can be no longer than five lines of code" - strikes me as being a little too inflexible. While this encourages good things like refactoring and use of private methods, sometimes I find that a longer method is essential. In my personal project I needed to pass a JSON object to the js file that fed my map and if I had broken this longer method into separate methods it would have called my database more times than was necessary and slowed the speed of the page load. I think with this rule in particular, there is a time and a place for it.

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