|
|
Log in / Subscribe / Register

Quote of the week

Quote of the week

Posted Mar 26, 2011 18:23 UTC (Sat) by Tobu (subscriber, #24111)
Parent article: Quote of the week

It's amusing to see this next to the Django 1.3 release announcement, which introduces class-based views.

The Pylons lead developer has argued that exposing the Pylons classes to inheritance exposed too much of the implementation, and prevented him from making some necessary evolutions to the framework. It's a big reason Pylons 1.0's successor, Pyramid, is mostly based on repoze.bfg (with zope-style components under the hood).


to post comments

Quote of the week

Posted Mar 26, 2011 22:33 UTC (Sat) by maney (subscriber, #12630) [Link]

Actually, I think Django's class-based views are a *great* example of the kind of "stuff is smeared all over dozens of classes/files" problem. I speak as one who, a couple weeks ago, sat down and puzzled out how those couple dozen classes get composed into the actual view classes (and I skipped the whole raft of date/time based stuff, as it wasn't relevant for me). Much head scratching, partial sketches, a wonderfully messy page full of class-representing blobs with snakey lines (different colors help) all over... I finally broke down and, rather than redraw it on a larger sheet of paper, used dia's UML boxes to make a readable version. Of course I found some things I'd gotten wrong, and then some more, and one trivial code duplication (bug filed with patch; was applied a few hours later).

And I still haven't migrated any of the views in the application I'm working on, which was the original motivation for all that. Sometimes that sort of thing makes you see your own code in a new light, and I've been doing a lot of refactoring, cleaning it up. And while that has seen one group of tightly-interacting functions get turned into class methods, none of the actual views have, and I'm starting to wonder if doing so is even a good idea. Asking myself that question, OTOH, has already been good for the codebase.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds