Some people on IRC told me a more lisp-ish style would be more
appropriate, 'no dangling brackets':

   [[socket isNil
      ifTrue:
         [
            [| conn |
            trycnt := trycnt + 1.


This is of course more compact, but I consider the first example more
readable. Of course in the end it's a matter of taste. But what style
do you recommend?

I will often use a mixture, based on the length of the block. For short blocks, I don't go to a new line; for longer ones, I use the style in your first example (the one I snipped).

Even when using the style I cite above, I will always put something after a keyword, unlike your example (i.e. I would have started the new line after "ifTrue: [").

The conversion tool generates code in the latter format, so soon enough the source code will all be in this format.

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to