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