| Typically it goes like this: 1. You found one case where complexity is essential. 2. That one case is not consistent with the rest of your app, and you were taught that inconsistency is bad. 3. Since you can't remove complexity from that case, for the sake of consistency you add complexity to all other cases. Class-based views is a typical example. You found a place where CBVs are useful. Now some parts of your app use functions, some use classes, that's inconsistent. Edit your style guide to enforce CBV everywhere. Now a simple healthcheck endpoint that returns "OK" has to be a class. As some folks used to say, you can write Java in any language. The right approach, of course, is to say "I'd rather have inconsistency than complexity". The challenge is that perception of complexity is subjective, but inconsistency is objective. So the right approach eventually loses, and every organization turns into a bureaucratic hell. |