[squeak-dev] Coding style

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Mar 10 17:15:33 UTC 2010


2010/3/10 Bert Freudenberg <bert at freudenbergs.de>:
> On 10.03.2010, at 11:29, Nicolas Cellier wrote:
>>
>> 2010/3/10 Bert Freudenberg <bert at freudenbergs.de>:
>>> On 10.03.2010, at 02:53, commits at source.squeak.org wrote:
>>>>
>>>> +     ^packageList ifNil:[packageList := (PackageInfo allPackages collect: [ :each | each packageName]) sort]!
>>>> -     ^packageList ifNil:[packageList := (MCWorkingCopy allManagers collect:[:each| each packageName]) sort]!
>>>
>>>
>>> This to me replaces one style of too few spaces with another of too many ;)
>>>
>>> I'd have written
>>>
>>>        collect: [:each | each packageName]
>>>
>>> but I just looked at the Blue Book and there indeed is a space before and after a block argument. OTOH it does conform to Kent's examples:
>>>
>>>        http://c2.com/ppr/formatting.html
>>>
>>> Generally I feel this is not much of a problem. But I have occasionally seen rather strange formatting, So for the benefit of better readability, do we want to have general rules for formatting code?
>>>
>>> Many projects have such rules. One good example IMHO is PEP-8 in the Python community.
>>>
>>> For Smalltalk I only know Kent Beck's rules from "Best Practice Patterns" which seem like a good set. And IMHO any rules are better than none, so maybe we want to just agree that if in doubt, follow that suggested practice?
>>>
>>> - Bert - (hoping this does not open a can of worms ...)
>>>
>>
>> Same discussion was just taking place at Pharo a few days ago.
>> There seem to be established rules also for Seaside & co package developpers.
>>
>> Nicolas
>
> Ah, can you point us to those rules? Simplest might be to just adopt them for trunk packages.
>
>
> - Bert -
>

We should ask Lukas probably, or just use the code formatter from RB?

Nicolas



More information about the Squeak-dev mailing list