tag:blogger.com,1999:blog-14094861.post2844032621241069392..comments2008-02-17T23:03:36.590ZComments on me->flub: Documenting functions/methods/classesFloris Bruynooghenoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-14094861.post-57184192961620742072008-02-17T23:03:00.000Z2008-02-17T23:03:00.000ZThere are standards for doc strings. See PEP 257 f...There are standards for doc strings. See <A HREF="http://www.python.org/dev/peps/pep-0257/" REL="nofollow">PEP 257</A> for details.Bobhttp://www.blogger.com/profile/08191171988896636276noreply@blogger.comtag:blogger.com,1999:blog-14094861.post-9656926499215190002008-02-15T20:14:00.000Z2008-02-15T20:14:00.000ZSpellchecking :(Commeting should *not* be separate...Spellchecking :(<BR/><BR/>Commeting should *not* be separated fromcode.<BR/><BR/>wheat, if comments get on your face, get a decent editor which supports comment folding (hides comment until they are clicked/cursor moved in).Mikko Ohtamaahttp://www.blogger.com/profile/14094668976260425816noreply@blogger.comtag:blogger.com,1999:blog-14094861.post-946246702800646822008-02-15T20:12:00.000Z2008-02-15T20:12:00.000ZI recommend you to check Epydoc:http://epydoc.sour...I recommend you to check Epydoc:<BR/><BR/>http://epydoc.sourceforge.net/<BR/><BR/>And if you feel you have something to contribute, check this ongoing thread<BR/><BR/>http://sourceforge.net/mailarchive/forum.php?thread_name=7b5b293c0802141901s12378271jcc068ba8d7d86902%40mail.gmail.com&forum_name=epydoc-devel<BR/><BR/>My personal view is that commenting should *not* be separated commenting, since it tends to drive developers lazy and leave commenting out. Zope/Plone is infamous for its steep learning curve.Mikko Ohtamaahttp://www.blogger.com/profile/14094668976260425816noreply@blogger.comtag:blogger.com,1999:blog-14094861.post-35317904763931993282008-02-13T06:52:00.000Z2008-02-13T06:52:00.000ZI've always found large bodies of text in code dis...I've always found large bodies of text in code distracting. Especially in<BR/>Python it just looks so nice and clean to have very sparsely documented<BR/>code. Of course, sparse documentation can be highly annoying for the <BR/>maintiner of said code.<BR/><BR/>Python's zope.interface package let's you separate documentation from<BR/>implementation. This has the disadvantage that you need to look elsewhere<BR/>in the code for the documentation, but the advantage is that you can give a <BR/>tricky subject a proper treatise without needing to scroll to see<BR/>method signature and body.<BR/><BR/>zope.interface works when used in conjunciton with zope.component <BR/>so that you can do the whole "pluggable implementations" thing, but in cases<BR/>where you are not using the component aspect you can do an import with<BR/>"implements as documented" to make it cleared that you are using interfaces<BR/>only for documentation.<BR/><BR/>Also note that interfaces are documented from the perspective of the <BR/>caller, so you don't document "self" in a method signature since that's<BR/>not supplied when you pass a message to that object. This means that you<BR/>can more easily cut-n-paste from an interfaces method signatures than an<BR/>implementations method signatures :)<BR/><BR/>>>> from zope.interface import implements as documented<BR/>>>> from zope.interface import Interface<BR/>>>> <BR/>>>> class IEggbeater(Interface):<BR/>... "Beats on eggs"<BR/>...<BR/>... eggyness = Attribute("How much egg needs to get beat")<BR/>...<BR/>... def whip_it(power_level):<BR/>... "Whip up the eggs at a desired power level"<BR/>... <BR/>>>> class Eggbeater(object):<BR/>... documented(IEggbeater)<BR/>...<BR/>... eggyness = 500<BR/>...<BR/>... def whip_it(self, power_level):<BR/>... return self.eggery * power_level<BR/>...Wheathttp://bud.ca/noreply@blogger.com