[Pharo-dev] Uniformizing Pharo

Camille Teruel camille.teruel at gmail.com
Sat Aug 17 05:07:51 EDT 2013


On 16 août 2013, at 21:57, Stéphane Ducasse wrote:

> 
> On Aug 16, 2013, at 3:59 PM, Camille Teruel <camille.teruel at gmail.com> wrote:
> 
>> Also, to prevent explosion of the number of protocol names in the image, we could agree on some naming convention.
>> 
>> For example, there are protocols ending with -ing and others ending with -ion: which form one should prefer?
>> ex: conversion vs converting, composing vs composition.
> 
> Yes this is the idea so let us define them.
> Here is what I have

So from your list, it seems that the convention is to use the -ing forms and to use spaces to separate words. 
Personally I prefer protocol names to be nouns instead of present participle: conversion, deletion, addition, comparison... 
But it's just a matter of taste and I understand it would involves too much changes. 
So do we stick to -ing everywhere?

If we do, you have exceptions in your list: 'instance creation', 'initialization' and 'value' instead of 'instantiating', 'initializing' and 'evaluating' (or something equivalent).

Also does it worth having both 'visiting' and 'visitor accepting' since it's the same concern and accept* and visit* methods are in different classes? 

Do you really want to have remove* methods in adding protocol?

What is this one: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings') ? 
Because setting has no implementors.

> 
> Stef
> 
> 
> ^OrderedCollection new
> 		add: MethodCategorizationRule forAccessors;
> 		
> 		"initialize"
> 		add: (MethodCategorizationRule whenSelectorMatches: 'initialize*' categorizeIn: #initialization);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'init*' categorizeIn: #initialization);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'default*' categorizeIn: #defaults);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'hash' categorizeIn: #comparing);
> 		"order is important"
> 		
> 		"testing"
> 		add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'has*' categorizeIn: #testing);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: '=' categorizeIn: #comparing);
> 		
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: 'new' categorizeIn: #'instance creation');
> 		add: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings');
> 
> 		add: (MethodCategorizationRule whenSelectorMatches: 'printOn:' categorizeIn: #printing);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'storeOn:' categorizeIn: #printing);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: '*copy*' categorizeIn: #copying);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: 'draw*' categorizeIn: #drawing);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'bench*' categorizeIn: #benchmarking);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'signal*' categorizeIn: #signalling);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'add*' categorizeIn: #adding);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'remove*' categorizeIn: #adding);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: 'open*' categorizeIn: #opening);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'update*' categorizeIn: #updating);
> 		add: (MethodCategorizationRule whenSelectorMatches: 'change*' categorizeIn: #updating);
> 		
> 		add: (MethodCategorizationRule whenSelectorMatches: 'accept*' categorizeIn: #'visitor accepting');
> 		add: (MethodCategorizationRule whenSelectorMatches: 'visit*' categorizeIn: #visiting);
> 
> 		add: (MethodCategorizationRule whenSelectorMatches: 'menu*' categorizeIn: #menus);
> 
> 		add: (MethodCategorizationRule whenSelectorMatches: 'value' categorizeIn: #value);
> 		
> 		"test cases"
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'test*'
> 					andClassInheritsFrom: TestCase
> 					categorizeIn: #tests);
> 					
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'setUp'
> 					andClassInheritsFrom: TestCase
> 					categorizeIn: #'setup');
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'tearDown'
> 					andClassInheritsFrom: TestCase
> 					categorizeIn: #'setup');
> 		
> 		"baselines, versions..."
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'version*'
> 					andClassMatches: 'ConfigurationOf*'
> 					categorizeIn: #'versions');
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'baseline*'
> 					andClassMatches: 'ConfigurationOf*'
> 					categorizeIn: #'baselines');
> 		add: (MethodCategorizationRule
> 					whenSelectorMatches: 'development*'
> 					andClassMatches: 'ConfigurationOf*'
> 					categorizeIn: #'symbolic');
> 		add: (MethodCategorizationRule 
> 					whenSelectorMatches: 'stable*'
> 					andClassMatches: 'ConfigurationOf*'
> 					categorizeIn: #'symbolic');
> 		
> 		
> 					
> 		add: MethodCategorizationRule usingMostUsedCategoryInSuperClasses;
> 		add: MethodCategorizationRule usingMostUsedCategoryInImage;
> 		yourself





More information about the Pharo-dev mailing list