[Zope3-Users] Buddydemo / coding style question

Kent Tenney ktenney at gmail.com
Thu Nov 18 07:52:58 EST 2004


Howdy,

I'm unsure about naming conventions.

http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ClassesAttributesMethods

says::

 "Methods also should start with a lower case letter.
The first word of a method should always be a verb 
that describes the action."

Is this recommending;

 class Buddy(persistent.Persistent):
    """Buddy information"""

    def name(self):
      return "%s %s" % (self._first, self._last)

be named;

  def getName(self):
      return "%s %s" % (self._first, self._last)

or is the 'get' assumed?

this if from 
http://dev.zope.org/Zope3/programmers_tutorial.pdf, slide 3

the name() method also seems to add leading underscores to first and last

Thanks,
Kent


More information about the Zope3-users mailing list