Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This should be the standard. Today, I'd argue that class based generic views are the most complex part of Django to learn. The concern is usually met with rather blunt responses like 'read the source code' or 'try harder'.

The goals of having a class based generic view was quite appealing with the possibility of leveraging inheritance and properties. But Mixins were probably the wrong way to achieve it. The Method Resolution Order can get very confusing leading to hard to resolve bugs. It seemed to be a very un-Pythonic ("If the implementation is hard to explain, it's a bad idea") implementation to me.



> I'd argue that class based generic views are the most complex part of Django to learn.

Also, after using them in a few projects, they reduce grokability and maintainability. Django's ORM is much more complex, but it operates at the right level of abstraction. CBVs always felt a bit too high level to work well. Going back and reading CBVs I wrote months ago always took more time than it feels like it should have.

That said, it took the ORM a while to get right, too, and the Django community is thoughtful when it comes to abstraction, and I'm sure views will land in a good spot.




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

Search: