This blog post explains why you should strive to keep your code simple. It explains what ‘simple’ means in this context and includes a real life code example.
To wrap up: You should always strife for the least amount of flexibility
There should be a reasonable amount of flexibility. In the example you can reduce flexibility by having fruitStore.stockLime and fruitStore.stockLemon instead of fruitStore.stockFruit but I think we all agree that it shouldn’t be that inflexible.
There should be a reasonable amount of flexibility. In the example you can reduce flexibility by having
fruitStore.stockLime
andfruitStore.stockLemon
instead offruitStore.stockFruit
but I think we all agree that it shouldn’t be that inflexible.