The Essence vs. Ceremony issue plays out at both strategic and tactical levels, but the tactical examples are the easiest to follow and understand in a small example. I used to give a conference talk demo of refactoring from ceremony to essence, but I never set the example in prose. Chad Fowler is teaching today, and wanted to show the example, so here it is:
Step 0. Initial Code
Step 1. Duck Typing
Step 2. Once you are duck typing, the local variable personForm is not needed.
Step 3. Return can be implicit (everything should return a value), and things can always go wrong (so there is no need to declare that an Exception can be thrown).
Step 4. Don't add a manager layer to MVC (yet). YAGNI.
Step 5. Conditionals make code expensive to test; so ceremonial conditionals are a particular nuisance. Let framework error handling deal with missing data on the form.
Step 6. All action methods have the same four arguments. Stop repeating yourself. Make them instance variables/methods on the controller instead.
Step 7. Let the model do double duty: backing the form and representing the database object. Adding a separate layer here is YAGNI until proven otherwise.
Step 8. Standard routing will already find the right view template, so don't be explicit.
We are a collection of experienced, thoughtful technologists, passionate about helping organizations deploy
technology effectively and humanely to build better futures. We like to work with you on the hard stuff.