Skip to content

Instantly share code, notes, and snippets.

@bethsecor
Created March 20, 2016 01:55
Show Gist options
  • Save bethsecor/61e9965e8adf0336274c to your computer and use it in GitHub Desktop.
Save bethsecor/61e9965e8adf0336274c to your computer and use it in GitHub Desktop.

Methods can be no longer than five lines of code.

I feel like this one is always tricky for me, it has forced me to keep thinking about how to refactor more, so my code has definitely improved since when I first started at Turing, but it's still really hard for me.

Controllers can instantiate only one object.

I almost made this one my first choice, because for my personal project I had a multi-model form, and how the heck would I have not passed all those objects to the view? Then I saw her solution to that and it made so much more sense! I could have made a PORO to initialize all the objects for my multi-model form and then initialize that in the controller and send it off to the view.

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