Thoughts

mental health break ,./'"**^^$_---
The justification for why the "simpler" default is wrong in the Pizza example is that it leaks data that doesn't need to exist at that level
The pizza class doesn't *need to know* what the default is. The default is a property of the menu. Even if you wanted to have a default dough and then in 2 years you decided to change what the default dough is, that information isn't a part of what defines a Pizza, so it shouldn't be a part of Pizza class. The Pizza class shouldn't care what your restaurant's default dough is. This applies to default values in the general case, to some extent—if the calling component is responsible for setting the value, the calling component should be responsible for defining the default value.
Link 6:38 p.m. Oct 15, 2024 UTC-4