On Feb 9, 2007, at 3:08 AM, Thomas Lotze wrote: > Jim Fulton wrote: > >>> when writing a buildout recipe, the cleanest thing is to use several >>> namespaces, like zc.recipe.egg does. >> >> I don't agree that this is cleanest. I made a mistake by >> introducing the >> recipe namespace. New recipes I write won't use this. "Flat is >> better >> than nested." > > To comment on buildout specifically, which I had only brought up as an > example, though: > > While I agree with "flat is better than nested" most of the time, I > don't when it comes to buildout recipes. It's the nature of buildout > that some recipes deal with software that has a name of its own, or > with general concepts. You wouldn't want to call a recipe for > installing > libfoo something like zc.foo or zc.libfoo
Right, I'd call it zc.libfoorecipe. > as everybody would think it's > your libfoo binding, and a name such as gocept.download is a bit too > non-descriptive for my taste. So there should be a hint at > buildout or > recipes in the (dotted) name. Personally, I prefer a recipe > namespace > for recipes that deal with third-party software or generalities, > and a > recipe subpackage for one's own projects. Anything else feels rather > non-elegant to me, but this might just be a matter of taste. > What's your > preferred naming scheme for new recipes? namespace.foorecipe. Abstractly, namespace.recipe.foo is appealing except for the directory management issue. But the directory management issue is a significant one. ... >> IMO, the only needed hygiene is the top-level namespace. (Maybe a >> huge >> organization would need sub namespaces, but we don't.) > > I don't think it's a matter of running out of names when you have > to name > too many unrelated things, Maybe not for you, but it is for me. In particular, I want to be able to name something without worrying about whether someone else has taken the name. The zc namespace protects me from that. I only need one level of namespace for that. > but one of finding concise and descriptive > names for related or generic stuff. Descriptive and unique names in > a flat > namespace tend to grow long and in some cases, unreadable unless you > violate PEP 8 and stick in an underscore or two. > > For example, I'm writing a bunch of buildout recipes for Apache > stuff, and > I'm not going to choose names such as tl.apache or > tl.buildoutmodpython. > Without introducing a namespace for my buildout recipes, > buildout_apache > and buildout_modpython is the least annoying naming scheme I can > come up > with. Why not just tl.apacherecipes, which could contain all of your apache recipes. > (BTW: Did I just miss something, or do recipes for these really not > exist yet?) I don't know, are you done yet? ;) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
