Method names

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Feb 7 13:08:46 GMT 2011


On Sat, 5 Feb 2011 19:00:37 +0100, Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
> On Sat, Feb 05, 2011 at 11:24:44AM -0500, Ethan Glasser-Camp wrote:
> > 
> > How do we feel about consistency of naming conventions in the code
> > base?

Thanks for bringing this up. I found reading things like
getmessageinternaldateconfigparser somewhat exhausting too and would
love us to move towards underscore names, even if that means internal
inconsistency during the transition.

The second change I would love to see is moving us from some very
frequently used "getXXX" methods to properties, e.g. rather than "Repository.getname()"
use the read-only property "Repository.name". I find code using many of
those properties easier to read (shorter). Do note that python did a
similar thing by e.g. moving from Thread.getName() to
Thread.name. Fortunately, we don't have to preserve backwards
compatibility within our code base.

so +1 for underscores.

> I don't care much myself about naming conventions. I do about
> readability of the code. Naming conventions are not _that_ important for
> readability.  Smart names, good refactoring, etc are much more important
> than the way functions and classes look: with or without underscore is
> not (and should not be) the point, IMHO.

I agree that wisely chosen "RUNWORDSTOGETHER" names are much better than
"badly_chosen_underscore_names". But assuming we chose good names, I would
always prefer the underscore version myself. 

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110207/254b2a32/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list