Martin McClure <mar...@...> writes:

> Actually, I usually do prefer to use first person when writing Smalltalk
> comments. I find that anthropomorphizing objects helps to think in an
> object-oriented way.

Thanks everyone for all the answers so far!

One of the things that keep confusing me is whether the I refers to the class,
 the object or (in a method comment) to the method or even the method
 activation? For example in Randal's example, there it is the the behavior
 *class* speaking in first person. Whereas to my understanding in
 *object*-oriented programming the objects should talk be first person (not the
 classes).

Even more confusing, I have also seen comments where the it was the object or
 the methods. Or most confusing, an amalgamation of both, as eg in "I return my
 first element" where to be precise the method activation returns the first
 element of the object. So shouldn't it either be "(When activiated) Returns my
 first element" or "I return the first element of my reciever"? 

This is not an academic example. When I started to write comments for SUnit, I
 got actually confused. When writing (instance/class) methods comments, to whom
 does the "I" refer to?   

--AA


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to