[Pharo-users] On Class and Method comments

stepharo stepharo at free.fr
Tue May 17 15:54:22 EDT 2016


> I really like to start writing some class and method comments to make 
> Pharo image more beginner friendly.

This would be realllllllllly coool.
Did you check the class comment template because I wrote it thinking 
about this.

What I think would be great is to have great comments for the basic 
classes. Because as a newby such classes are really important.

For example I would like to enhance the symbol class comment to include 
the snippet sent by henrik

| s1 s2 |
s1 := 1234 asString. s2 := 1234 asString.
s1 = s2. "true" s1 == s2. "false"
s1 asSymbol = s2 asSymbol. "true" s1 asSymbol == s2 asSymbol. "true"
(s1 class allInstances select: [:s | s = s1 ]) size. "2" (s1 asSymbol 
class allInstances select: [:s | s = s1 asSymbol ]) size. "1"
[ #stringA = #stringB ] bench. "26,812,864 per second" [ 'StringA' = 
'StringB' ] bench. "3,492,987 per second"
> Are there any guidelines when and how to comment classes and methods ? 
> What about inline comments ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160517/b1e0784f/attachment.html>


More information about the Pharo-users mailing list