← Back to team overview

oship-dev team mailing list archive

Coding Styles

 

Hi All,

While it was covered in the past and probably those documents have aged
away.  I want to point out some things to do so that we stay consistent.

1.  All indentation should be spaces only.  NO TABS.
2.  All indentation should be set to 4 spaces.
3.  In accordance with Python Zen: Explicit is better than implicit.
    When specifying an import this is especially important.
i.e.  in the openehr directory: use from oship.openehr.common import
Locatable vs. from common import Locatable ...or even worse import
common *  Though in some eggs there is code in the module __init.py__
and a module import ex. "import grok" is required.

I'll be adding a section in the documentation over the next few days to
cover these and other things. 

Thanks for all your work.....

--Tim
PS:

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>> 





-- 
***************************************************************
Timothy Cook, MSc

LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == (upon request)
Academic.Edu Profile: http://uff.academia.edu/TimothyCook

You may get my Public GPG key from  popular keyservers or    
from this link http://timothywayne.cook.googlepages.com/home 

Attachment: signature.asc
Description: This is a digitally signed message part