Hacker News new | past | comments | ask | show | jobs | submit login

>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.




Preferring 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.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: