21 Oct 2006 12:54
Thought of the day...
G'day,
So here is my thought for the day:-
"Maximum of ONE loop ('for', 'while') per method."
The reasoning is that methods that handle iteration should (*most of the time*)
be written such that they:-
1) Either process an entire list of things
or
2) Process a single thing
e.g.
class Foo(HasTraits):
def some_method(self, ...):
""" Do some stuff. """
...
...
for blargle in self.blargles:
# You often see a block comment here...
# ... explaining what is being done to the
# blargle. If only this comment was in the
# API docs ;^)
(Continue reading)
RSS Feed