Jason Tackaberry wrote: > On 2007-09-06 11:53, Dirk Meyer wrote: >> Right. Doc inside the source is also very helpfull. Besides that, I >> wrote down some coding style rules. Not every rule is as important as >> the other one and not every dev uses these rules, but it is a good >> guideline: > > I know we've argued about some of these rules. :) > > At the very least, 4 needs to be changed from 80 to 120, since we both > agreed on this one.
Yes > Also, 3 maybe needs to be reworded. I obviously don't disagree about > adding more code documentation, but you said to add comments to the > effect of "add xy to z" which, when interpreted the way I do, I rather > think is not only pointless but a bit embarrassing. > > I'm reminded of some code submitted by a web hosting company that I > reviewed at a previous job. One of my initial requirements for the > project is that the code had to be well documented. As a result, the > code was riddled with meaninglessness like this: > > # increment x by one > $x += 1; OK, that is pointless. But when porting some code to Freevo 2.0 I found something like 'if isinstance(x, SomeClass)' and I wondered how this could happen. This is were I want some doc. > Might also be worth mentioning the convention of prefixing private > methods and variables with underscores. Although that's something that > even our own code is not so consistent with. :) Yes. The good way would be to use _ for something like protected. Only use this in the same module. But I also like __ which is private, only this class can access it and a class inhertig it can reuse that var. It is a nice feature class A(object): __somevar = 4 class B(A): __somevar = 5 These are two different variables. It is nice to use this because you don't have to look at A when writing B if somevar is alreday used. Dischi -- "There is no law requiring me to make sense."
pgpRE9CLo0xXo.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel