Michele Cella posted some interessting links to Turbogears-trunk

This inspired me to share some early feedback after writing two applications using about 600 lines of Kid 0.8 template that we have in production. The Kid templates are part of an web front end to a automated testing framework I develop at work.

By the way, I have no strong view that everything should be done in XML, or for that matter that everything really has to be well formed all the time. I just want something productive, which for me means Pythonic as that's how my brain works.

+ I'm getting more stuff done than I was before.
+ The documentation and mailing list are good.
+ There's a plesant feeling from splitting out the view and the controller code, and it seems good for the soul :).
+ Decouplinig Python logic from bits of XML make it a lot easier to reason about what is being generated.
- It's sometimes too tempting to put what is really controlloer logic into the template
- It wasn't clear to me how to stream HTML out when using Kid with turbogears or directly CherryPy, which means that the web front end feels quite clunky to users.
- Badly formed Kid 0.8 templates produce fairly useless errors, since you end up with a source location in the generated python module and not the kid template (is this fixed in 0.9).
- Python's white space significance is awkward when you have bits of python embedded in an XML document.
- Kid templates are hard to edit effectively since your editor needs to be wise to both XML and Python.
- I seem to end up with more duplication than I'd like in my templates.

For the kind of small project I'm doing, to be honest HTMLTags ( http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366000)  from little CherryPy applications feels a lot faster to develop. Not least because, for small projects, I can keep the view and controller logic all in one file, which becomes a one stop shop for development. Note that the view and controller can be still quite separate within that file, and refactoring to split them up, or switch to Kid later, is probably not going to be too painful. I suppose I can get away with this while I do not work with people who understand HTML and CSS but not Python.

Guido van Rossum's comment at http://www.artima.com/weblogs/viewpost.jsp?thread=146647 is also relevant. I'm not currently as opinionated as him, as I can see the value of an XML template if you are working with those who heads explode when you show them Python.

Thanks for all the hard work,

Dickon

Reply via email to