Glad to see this debate happening, because for a long time I felt like I 
was the only one who had issues with CBVs. I forced myself to use CBVs 
(custom and generics) on two major projects and I'm still struggling to see 
the real value in them.

Luke's post did an excellent job of articulating the issues, so I won't 
bother repeating the same arguments.

However, one of the things I find with CBVs is that it encourages a 
programming style that doesn't seem to go well with the TDD approach (at 
least in my opinion):

With FBVs, I would start writing the code for my view, satisfying the test, 
then going back and refactoring the view code by looking for commonalities 
with other views (Write code > Pass Test > Refactor)

With CBVs, I tend to start by searching for an appropriate parent/base 
class to subclass, then writing my custom view code and satisfying the 
test. I see this as forcing the refactoring first before writing custom 
code (Refactor > Write code > Pass Test)

Not sure if anyone else feels the same way, but it's good to hear all the 
different perspectives on this.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/jMkryR-q8YcJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to