Skip to content

Instantly share code, notes, and snippets.

@bethsebian
Created March 19, 2016 20:26
Show Gist options
  • Save bethsebian/b7262bbe6c6fd65e0c56 to your computer and use it in GitHub Desktop.
Save bethsebian/b7262bbe6c6fd65e0c56 to your computer and use it in GitHub Desktop.

Which of Sandi's rules do you feel like might be the hardest to follow—why? Rule 3, limit params passed to method to 4, including hashes, would be the most difficult. I agree it clutters code to call a method and pass it multiple params, but in the case of hashes, the benefit does not seem so clear.

My main question is how that affects creating objects from form data. We're accustomed to passing object params to a model, after verifying them with a private method that allows us to ensure we are only passing user-generated data we know is safe and useful. Haha...just answered my own question here: remembered that we don't actually pass the private object_params method params, that the private object_params method has access to those params and we don't need to pass them through.

I image there are still cases when passing a set of attributes along in a hash, between controller and model for example, would be handy.

@Fajarsaputra
Copy link

L'am have hacker to friends ,can we friends oke

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