[SPAM] [squeak-dev] code formatting

Rob Withers reefedjib at yahoo.com
Mon Jun 28 08:27:42 UTC 2010


I take it you like C over D as well...?

I hadn't thought of adding a space.  Good idea!  A and C were my versions...

Thanks,
Rob



--------------------------------------------------
From: "Sven Van Caekenberghe" <sven at beta9.be>
Sent: Monday, June 28, 2010 3:30 AM
To: "The general-purpose Squeak developers list" 
<squeak-dev at lists.squeakfoundation.org>
Subject: Re: [SPAM] [squeak-dev] code formatting

>
> On 27 Jun 2010, at 22:59, Rob Withers wrote:
>
>> case A:
>> SocketEndpointBottom>>#send: data
>> self isConnected
>> ifTrue: [[self socket sendSomeData: data]
>> on: Error
>> do: [:ex |
>> self socket notNil
>> ifTrue: [self socket closeAndDestroy].
>> SSLSendError signal: ex messageText]]
>> ifFalse: [self socket notNil
>> ifTrue: [self socket closeAndDestroy]]
>
> I like A the best, its the most compact and still sematically structured.
> Personally I add extra space inbetween square brackets, like this:
>
> case A:
> SocketEndpointBottom>>#send: data
> self isConnected
> ifTrue: [ [ self socket sendSomeData: data ]
> on: Error
> do: [ :ex |
> self socket notNil
> ifTrue: [ self socket closeAndDestroy ].
> SSLSendError signal: ex messageText ] ]
> ifFalse: [ self socket notNil
> ifTrue: [ self socket closeAndDestroy ] ]
>
> It gives the code a bit more 'breathing room'.
> I picked this up from exiting code, I see it a lot in the Seaside code 
> base.
>
> Sven
>
>
> 



More information about the Squeak-dev mailing list