Table of Contents
1. Inject dependency instead of sending a boolean
2. Use a NilObject as fallback value
3. Use validator object
...
For further actions, you may consider blocking this person and/or reporting abuse
Great examples! Some of them gave me Java vibes but in a positive way.
The one I liked most is the example n.2, that could have saved us a lot of bug at work 😂
Ahaha I completely understand the Java vibe.
I’m a bigger project, having a NilObject can help by introducing some default behavior. In my exemple I just have 1 method. But when you have several attributes and stuff it shine a lot 🧞♂️