[squeak-dev] Formatting?

Levente Uzonyi leves at caesar.elte.hu
Thu Jun 2 18:09:31 UTC 2016


On Thu, 2 Jun 2016, tim Rowledge 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.

Close, but not exactly the same:

  	coll do: [ :each |
  		statement.
  		argument.
  		resolution ]

If I could change the syntax, I'd make the vertical bar optional, because 
that's just a filler with no purpose:

 	coll do: [ :each
 		statement.
  		argument.
  		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.

Perhaps this discussion will annoy someone enough to volunteer to finally 
write a configurable pretty printer. :)

Levente

>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: IO: Illogical Or
>
>
>
>


More information about the Squeak-dev mailing list