Guest User

Untitled

a guest
Feb 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Reasons side effects are not bad but evil.
  2.  
  3. - Having a side effect means you are always working, testing, and thinking about more than one unit
  4. - They often break one or more of the following principles SRP, Law of Demeter, Encapsulation, etc
  5. - Creates known & unknown implicit dependencies
  6. - Side effects can also have side effects (ahem... ActiveRecord callbacks)
  7. - Causes more code churn. Changes in one area cascade to other areas.
  8. - Makes test setup harder. Your test setup contains objects that are seemingly unrelated to the code under test.
  9.  
  10. Alternate titles:
  11. - Learning to Shave a Yaks while Programming
  12. - Side Effects are like CSS for the rest of your code; all changes cascade.
Add Comment
Please, Sign In to add comment