Monday, October 5, 2009

Why TurboGears Instead of Zope / Plone?

Zope and Plone are the most recent ones I tried to work with. I'm discussing them together because Plone is built on top of Zope, so it inherits any/all good (and bad) things from Zope.

So, why did I eventually abandon Zope and Plone?

Zope uses an object database. This is neither good nor bad, it is simply a different way of storing the data. However, it does wind up dictating many things to you as a developer that you might not like very much.

For instance, in order to query the database and retrieve data stored in it, you must have a compatible class for the object in your sys.path. Without that, you will not be able to access the data stored in the database. To provide a concrete example, I was using Plone 2.5.3, and needed a wiki. ZWiki managed to provide what I needed, and so it got used. When it came time to upgrade to Plone 3.0, I could not access the database on another machine without doing careful version matching of everything. Anytime I tried, I would get very long tracebacks in my browser, resulting in me having to unwind and translate everything to find the specific issue.

The worst part of this was that, instead of affecting only the wiki, it affected the entire site, as the main page referred to the wiki area. When that section of the page was rendered, it would ask the ZWiki object for information (titles, for example). Since the ZWiki class(es) could not be loaded from sys.path, the main page of the site was broken, and I was unable to fix it.

As another side effect, the database will grow without limit, since Zope stores all versions of objects until you tell it to purge them. You can schedule this, but that will be an external process.

Finally, we come to zc.buildout. After spending several weeks, I was unable to find any documentation (that made sense) for how to use buildout. As a result, I could only do weak copy and paste type operations, leaving me at the mercy of whatever recipes I was using.

I like Zope. I think it looks like an amazing piece of technology. I also think it's too opaque for me. Every so often, I felt like I had managed to make some progress, but in the end, I could not gain sufficient understanding of Zope to make it work for me.

And then comes a discussion about Plone. Plone has documentation on documentation. It's possible to start reading about Plone, and keep on reading for months. In the end, though, it suffers from the same issues that plague Zope: Opacity. For me, Plone is completely opaque.

I bought the books. I read the tutorials. I worked through everything. And, in the end, all I could get Plone to do was to let me install ZWiki and have a custom theme (that I never did understand well enough to make it look right).

And, for all of that effort, I still had to run it on a fairly powerful machine: dual processor, dual core opterons with 4G of RAM. And the page loads were still noticeably sluggish.

I feel like I was able to learn next to nothing about Zope and Plone after several months of trying. The system was always outside of my control, and relied on the maintainers of the products I needed to be stable. If ever they made an incompatible change, I would be the one to suffer. And I was powerless to fix it.

When I finally twigged on to TurboGears, though, I found something wholly different: A system that made sense to me. It's not completely mastered by me, not yet. But I can see that I have the tools available to me to master it. The code is there, it's understandable, and it's extensible.

They use the more traditional SQL databases by default, which is also more understandable and easier to extract the data. This, in turn, means that it's easier to manage third party products without rendering the whole site useless.

For me, at least, TurboGears made sense where Zope and Plone do not. Make no mistake: For other people, those two products are the greatest thing ever. I even concede their overall quality. I just couldn't gain control over them, and couldn't figure out what I needed to learn to gain that control.

I'll stick with TurboGears. I hope you'll come on that journey with me, since I'm definitely enjoying it.

1 comment:

Dennis Daniels said...

Be great if you included screencasts of what didn't work for you.