5 ms·
>I think that comes down to how comfortable you are with classes and multiple inheritance and what No, not really. Multiple layers of inheritance naturally cau
by hitchstory 3y ago
>I think that comes down to how comfortable you are with classes and multiple inheritance and what
No, not really. Multiple layers of inheritance naturally causes code to lose cohesion no matter how familiar you are with it.
It's one of the reasons for the maxim "prefer composition over inheritance".
>But in my experience, FBVs become a mess even if they're relatively simple, because of the temptation to keep it all within a single function.
If calling functions or classes from within functions is a struggle I dare say you might have bigger problems than whether to use FBVs or CBVs.
- dec0dedab0de 3y agoPreferring composition over inheritance is good for languages that don't do inheritance well. Python does it well. But more importantly, Django is an object oriented framework that makes heavy use of multiple inheritance, and the code is gorgeous. It seems silly to choose a big framework like Django and not take advantage of it's features.