Re: agx: Moving forward
Daniel Nouri <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
Martin Aspeli wrote: > On Mon, 06 Feb 2006 02:01:34 -0000, Daniel Nouri > <[email protected]> wrote: > >> Martin Aspeli wrote: >>> >>> Can you be a bit more specific what's ugly about the code it generates? >>> I believe that in the later versions, the code is fairly good. >> >> >> One thing that scares me is that with ArchGenXML every class has its own >> module. > > > This is fairly common practice with Archetypes anyway. In fact, nearly > every project I've seen has its own .py file for each class. I suppose > if you have a lot of mixin-classes etc. that may not be optimal, but > for most content type scenarios, this tends to make it easier to browse > the code in my experience. I'm maybe being too picky. You're right: One class per module is common practise with AT projects, for better or worse. With Genesis we shouldn't really have that 1:1 relationship anymore. Genesis aims to be a general purpose code generator, and the one class per module is really only an AT convention, and it feels all javaish and clumsy to me. But that's really details we shouldn't be getting into now. >> And then its raving use of newlines. > > > mmmm.... I'm normally quite picky about whitespace, and deo is normally > the worst. Deo has made a few fixes lately, and I made some earlier. It > doesn't offend me so much any more. > >> Or that it creates >> docstrings for every of your methods, even if there's no documentation >> yet, which clutters up the code. > > > I think this is great. You should be filling in those docstrings. I > have nightmares about the kind of third party products that don't make > proper use of docstrings. > > If they're there and look ugly to you, go fill them in. AGX will leave > the comments alone if you modify them in code. Of course I should use docstrings. But do the empty docstrings that ArchGenXML generates for me really help? Because thank you ArchGenXML, I think I can type in the triple quotes my own when I need them! >> Some problems I have with ArchGenXML >> generated code arguably originate in how people use it. This file of >> the agx (soon-to-be 'genesis') project itself is a good example of some >> of the problems mentioned: >> >> http://svn.plone.org/svn/collective/agx/trunk/transformations/python/pyattributeadapter.py >> >> >> Files like this don't really help. > > > Well sure, but it's obviously a file that isn't finished. How can you > judge a CASE tool by people leaving unfinished files around? Well, empty files that lie around seem like "common practise" for the projects that I see. It's really nasty for someone who tries to get into the project and contribute to see those empty files around. So I say "Death to the ArchGenXML generated code in Genesis"! Working around the ArchGenXML stuff in a project that aims to learn from its predecessor's mistakes is no fun. > The two things that annoy me the most the with the code AGX generates are: > > - Excessive use of comments. Having the full GPL header at the top of > every file is pointless (it's not a legal requirement). I know you can > override this, but I'd like it not to be the default. I totally agree. > - A few of those ugly getattr() things, but then again I don't know > any way around that without putting a lot more burden on the user > knowing what to inherit schemata, interfaces etc. from. +1 > >>> I'd drop any and all reference to Arch or XML in the title if at all >>> possible. Stupid names have been known to hold back good ideas >>> before. :) >> >> >> I think we already agreed on this. I put the renaming of agx to genesis >> to the top of my TODO list. :-) > > > Last I heard, the "compromise" was to call it "AGX Codename Gensis", > which I think achieves exactly the opposite of reducing confusion. :) I think I agreed with Jens on the Snowsprint. Anyone who wants to spend more cycles on this, please speak up now. Daniel ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642