Lukas do you have some code samples.
Something that I particularly hate is the following
self bla ifTrue: [
...
] ifFalse: [
...
]
That is see in the code.
I want
self bla
ifTrue: [ ...
]
ifFalse: [
... ]
> I would use a formatter, like this you can make it really consistent.
> The RBConfigurableFormatter is pretty good in that, the only thing I
> don't like is the placing of the square brackets. I should look into
> fixing that, otherwise it formats exactly the way I would format
> myself (and in the way you propose).
I would really like to play with the idea of automatic formatting
to see how it goes.
Stef
>
> Lukas
>
> On 28 February 2010 10:36, stephane ducasse <[email protected]> wrote:
>> Hi guys
>>
>> I would like to build a set of canonical code formatting convention for
>> Pharo.
>> I need your help. Now take time before replying :)
>> I would like to structure the discussion and proceed step by step. So at max
>> I would like to discuss one or two formatting approach per mail.
>> Once we agree I would like to define a wiki page.
>>
>>
>> **Space after : rule
>> =============
>> for example I would like to always have a space after a :
>>
>> classes := Smalltalk allClasses select:[:aClass|
>> (aClass class includesSelector: #cleanUp)
>> or:[aClass class includesSelector: #cleanUp:]
>> ].
>>
>> ->
>>
>>
>> classes := Smalltalk allClasses select: [:aClass|
>> (aClass class includesSelector: #cleanUp)
>> or: [aClass class includesSelector: #cleanUp:]
>> ].
>>
>>
>> **Block arg rule
>> =============
>> Do we want a space before and after block arg
>>
>> Smalltalk allClasses select: [:aClass :method|
>>
>> -> Smalltalk allClasses select: [ :aClass :method |
>>
>>
>> ** selector or block indented compared to receiver
>> =======================================
>>
>> Finally do we follow kent block ideas?
>>
>> classes := Smalltalk allClasses select: [:aClass|
>> (aClass class includesSelector: #cleanUp)
>> or: [aClass class includesSelector: #cleanUp:]
>> ].
>>
>> ->
>> classes := Smalltalk allClasses
>> select: [:aClass| (aClass class includesSelector:
>> #cleanUp)
>> or: [aClass class
>> includesSelector: #cleanUp:]].
>>
>> Stef
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project