Alexander Bandukwala

42%
Flag icon
This principle says that you shouldn’t make decisions based on the internal state of an object and then update that object. Doing so totally destroys the benefits of encapsulation and, in doing so, spreads the knowledge of the implementation throughout the code. So the first fix for our train wreck is to delegate the discounting to the total object:
Alexander Bandukwala
Is this equally true with immutability?
The Pragmatic Programmer: Your Journey to Mastery, 20th Anniversary Edition
Rate this book
Clear rating
Open Preview