Re: [Pythoncad-developer] coding convention
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Matteo B. <mat...@bo...> - 2010-03-10 06:47:23
|
Hi guys , I would like to add this little trick .. Actually some IDE like (Eric) recognize automatically some special comment so .... please write TODO : "Your message " for something you are going to do and FIXME : "Your message" if you know of an error and need to be fixed Regards, Matteo On Fri, 2010-02-05 at 11:28 +0000, ger...@gm... wrote: > Hi Matteo, > > For me your convention is OK. > The most important is that we all use the same convention. > > Regards, > Gertwin > > > > Op schreef Matteo Boscolo <mat...@bo...>: > > > > > > > > > > > > > > > > > > > > > > > > > > > > For me the convention is ok, > > > > But insted of using an underscore for the function name I prefer > > to have the Upper case letter of the first word ..like this: > > > > > > > > For Function: > > > > def getLineFromSegment(): > > > > instead of > > > > def get_line_form_segment(): > > > > > > > > For Classes: > > > > Class Segment(object): > > > > > > > > and I like to have the descriprion on each functions/class like > > this > > > > def line(x,y,x1,y1): > > > > “”” > > > > Create > > a line > > > > > > x: double coordinate of the x point > > > > “”” > > > > > > > > For me it’s very important the documentation of each > > function / class > > > > > > > > In case of global variable we can use the UPPER Case and the > > underline to separate the words > > > > DEBUG_GUI=True > > > > > > > > Let me know if for you this conversion is ok > > > > > > > > Regards, > > > > Matteo > > > > > > > > > > > > > > > > > > > > From: > > ger...@gm... [mailto:ger...@gm...] > > > > Sent: 04 February 2010 07:56 > > > > To: Yagnesh Desai; pythoncad-developer > > > > Subject: Re: [Pythoncad-developer] coding convention > > > > > > > > > > > > > > Hi Yagnesh, > > > > > > > > That's all right, your skills will improve. > > > > We all can learn from each other. > > > > > > > > I saw Arts coding conventions just recently. > > > > It is good to have some unity in our code. > > > > > > > > Regards, > > > > Gertwin > > > > > > > > > > > > Op schreef Yagnesh Desai yn...@gm...>: > > > > > Gretwin; > > > > > > > > > > > > > > > > > > > > I know the coding done by me needs lot of touch up. > > > > > > > > > > > > > > > > > > > > I need to improve my coding skills as this is the first time > > > > > > > > > > I am doing any coding for such project. I only used to > > > > > > > > > > do editing of recorded macros. > > > > > > > > > > > > > > > > > > > > Also I am not good at OOP and whatever coding I did > > > > > > > > > > was with good help of Matteo. > > > > > > > > > > > > > > > > > > > > Hope to improve and learn more while contributing to > > > > > > > > > > PythonCAD. > > > > > > > > > > > > > > > > > > > > If the convention in old wiki is what can be followed > > > > > > > > > > we must use it for there must not be any difference > > > > > > > > > > in the way old and new one. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Feb 4, 2010 at 2:07 AM, Gertwin Groen > ger...@gm...> > > wrote: > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > > > > > > > Now the we start working on the best PythonCAD ever it is time > to > > > > > > > > > > > think about some coding convention. > > > > > > > > > > > In the old wiki this is mentioned but it is not followed by us > in the > > > > > > > > > > > last months. > > > > > > > > > > > > > > > > > > > > > > I think the easiest thing to do is to follow the PyGTK coding > > conventions: > > > > > > > > > > > > > > > > > > > > > > example: > > > > > > > > > > > > > > > > > > > > > > class gtk.CellEditable(gobject.GInterface): > > > > > > > > > > > def start_editing(event) > > > > > > > > > > > def editing_done() > > > > > > > > > > > def remove_widget() > > > > > > > > > > > > > > > > > > > > > > Lower case package, module (and file) names. > > > > > > > > > > > Mixed upper and lower case for class names, each word starts > with a > > > > > > > > > > > capital letter. > > > > > > > > > > > Functions and class members are lower case, words are divided by > a > > underscore. > > > > > > > > > > > Variable names are lower case, words are divided by a > underscore. > > > > > > > > > > > > > > > > > > > > > > See the pygtk-demo for examples. > > > > > > > > > > > > > > > > > > > > > > Any comments? > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > Gertwin > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > > > > > > The Planet: dedicated and managed hosting, cloud storage, > colocation > > > > > > > > > > > Stay online with enterprise data centers and the best network in > the > > business > > > > > > > > > > > Choose flexible plans and management services without long-term > > contracts > > > > > > > > > > > Personal 24x7 support from experience hosting pros just a phone > call > > away. > > > > > > > > > > > http://p.sf.net/sfu/theplanet-com > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > Pythoncad-developer mailing list > > > > > > > > > > > Pyt...@li... > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Best regards > > > > > > > > > > > > > > > > > > > > Yagnesh Desai > > > > > > > > > > > > > > > > > > > > Save a tree...please don't print this e-mail. > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > > > > > The Planet: dedicated and managed hosting, cloud storage, > colocation > > > > > > > > > > Stay online with enterprise data centers and the best network in > the > > business > > > > > > > > > > Choose flexible plans and management services without long-term > contracts > > > > > > > > > > Personal 24x7 support from experience hosting pros just a phone > call away. > > > > > > > > > > http://p.sf.net/sfu/theplanet-com > > > > > > > > > > _______________________________________________ > > > > > > > > > > Pythoncad-developer mailing list > > > > > > > > > > Pyt...@li... > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > > > > > > > > > > > > > > > > |