Good commenting style?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Good commenting style?

Kannan Thambiah
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Squeakers,

I've just been reading through the Laser Game Manual by Stephan B  
Wessels, and stumbled upon the section where he suggested a method for  
leaving notes, i.e. ToDos in the source code (http://squeak.preeminent.org/tut2007/html/035B.html 
).

He suggests to enhance the Object class with a new method "revisit:  
aString", that doesn't have a method body. Instead every subclass of  
Object where we want to leave notes, we'll just send us a message,  
e.g. "self revisit: 'I still need to think about a more effective  
algorithm here'".

The trick is that now you can search for all senders of "revisit:" and  
have all your ToDos in one place.

What do you think about this approach?



Personally I dislike it. Though it is an interesting approach I  
somehow feel like cheating on the purpose of methods and messages. I  
don't know how to put it into better words, it just doesn't feel like  
neat, clean object oriented programming to me.

What do you think? And, more important, how do you keep track of your  
ToDos? How do you keep them in your comments, and how do you make them  
available to yourself in an overview?

Greetings,
pygospa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.11 (Darwin)

iEYEARECAAYFAkxUH7sACgkQSspvMUAssY4ipQCcDtbuAA4ixx+15WKq+qc6y2Tg
lgIAn2VrWRaslTgv4mSgRSb9KICnlJnp
=eVRL
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Good commenting style?

Mariano Abel Coca
I have a #toDo: method instead of #revisit: wich for me is more representative.

I also have a test that verifies that I have no #toDo: senders, and I run all the tests before closing a new version. But that's just a bonus.

For me it's not cheating, it's just a simple tool, programmed in Smalltalk. It's the same thing as #halt. It's a breakpoint, but you have to send the message in a method body when you want to add it. It's a hack, but it works great.

Cheers,

Mariano.


On Sat, Jul 31, 2010 at 10:05 AM, Kannan Thambiah <[hidden email]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Squeakers,

I've just been reading through the Laser Game Manual by Stephan B Wessels, and stumbled upon the section where he suggested a method for leaving notes, i.e. ToDos in the source code (http://squeak.preeminent.org/tut2007/html/035B.html).

He suggests to enhance the Object class with a new method "revisit: aString", that doesn't have a method body. Instead every subclass of Object where we want to leave notes, we'll just send us a message, e.g. "self revisit: 'I still need to think about a more effective algorithm here'".

The trick is that now you can search for all senders of "revisit:" and have all your ToDos in one place.

What do you think about this approach?



Personally I dislike it. Though it is an interesting approach I somehow feel like cheating on the purpose of methods and messages. I don't know how to put it into better words, it just doesn't feel like neat, clean object oriented programming to me.

What do you think? And, more important, how do you keep track of your ToDos? How do you keep them in your comments, and how do you make them available to yourself in an overview?

Greetings,
pygospa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.11 (Darwin)

iEYEARECAAYFAkxUH7sACgkQSspvMUAssY4ipQCcDtbuAA4ixx+15WKq+qc6y2Tg
lgIAn2VrWRaslTgv4mSgRSb9KICnlJnp
=eVRL
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Good commenting style?

K K Subbu
In reply to this post by Kannan Thambiah
On Saturday 31 Jul 2010 6:35:46 pm Kannan Thambiah wrote:
> He suggests to enhance the Object class with a new method "revisit:
> aString", that doesn't have a method body. Instead every subclass of
> Object where we want to leave notes, we'll just send us a message,
> e.g. "self revisit: 'I still need to think about a more effective
> algorithm here'".
Squeak has a flag: method for such memos. e.g.
      self flag: #thinkDeeper. "I still need to think ..."

Later one can search for all senders of #thinkDeeper to corral all methods
that need rework.

FYI .. Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners