[squeak-dev] Formatting?
Eliot Miranda
eliot.miranda at gmail.com
Thu Jun 2 19:23:43 UTC 2016
On Thu, Jun 2, 2016 at 9:25 AM, tim Rowledge <tim at rowledge.org> wrote:
> {snipping lots}
> > On 02-06-2016, at 8:19 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> >
> >>
> >> braceAtTheEndOfLine ifTrue: [
> >> (this isA: #Monstrosity) because:
> >> blocks are objects not syntax].
> >
> > This is absolutely personal preference, but I prefer to have blocks have
> > similar syntax as methods, because that makes it easier to read code.
> > This means that the first line, which contains the opening bracket and
> the argument names, is far less important than what the block does, so it's
> perfectly okay to leave it on the previous line.
>
> So I think you mean
> coll do: [:each|
> statement.
> argument.
> resolution].
> … which is pretty much how I prefer things.
>
No. That puts the start of the block to the right of the first line of the
block. That's not rectangular at all. i.e. "statement" is to the left of
"[:each|". It should be
coll do:
[:each|
statement.
argument.
resolution].
Here, all the text of the block is included in the recangle formed by
"[:each|" and "resolution]".
> We should be very careful about discussing this. I don’t think anything
> causes more annoyance, hard feeling, lost friendships, broken communities,
> lost projects and global war than syntactic debates.
>
Understood. Bt Kent gives v good rationale for all elements of his style
guide, and one way of avoiding conflicts over formatting is to have and
observe as much as possible, and support with tools, a house style.
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: IO: Illogical Or
>
>
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160602/49ed761e/attachment.htm
More information about the Squeak-dev
mailing list
|