Last active
February 14, 2018 01:55
-
-
Save morganick/af96c1b4c9264eebf0385c8db6c1ce40 to your computer and use it in GitHub Desktop.
@searls needed some convincing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment