Convention for "reset" methods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Convention for "reset" methods

CyrilFerlicot
Hi,

Torsten is doing a really cool job by cleaning the protocols of Pharo.

Smalltalk has a lot of conventions and if we want the users to apply
them we need to have a clean Pharo.

On that subject I was wondering…

Do we have a real convention for "reset" methods?

With this script:

((RPackageOrganizer default packages flatCollect: #methods) select: [
:each | each selector = #reset ]) collect: #protocol as: Bag

We can see that there is different way to do.

25 in accessing
11 in initialization
10 in positioning
10 in instance creation
And some others less popular choices.

So my question is, should we have a conventional protocol for reset methods?

For now, most of them are in "accessing", but it cause a violation of
the RBUnaryAccessingMethodWithoutReturnRule.

Personally I think that "initialization" protocol make the more sens.

If the community agree on it we could
- Recategorize
- Make sure the automatic categorizer follow the convention
- Add a rule/test to check that

Waiting for your thoughts :)

--
Cyril Ferlicot
https://ferlicot.fr

http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France

Reply | Threaded
Open this post in threaded view
|

Re: Convention for "reset" methods

Sean P. DeNigris
Administrator
CyrilFerlicot wrote
> So my question is, should we have a conventional protocol for reset
> methods?

Out of those choices, accessing and instance creation seem the worst. I
agree that initialization seems best out of those.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Convention for "reset" methods

Ben Coman
In reply to this post by CyrilFerlicot
+1. I think "accessing" sometimes ends up the default catch-all. "Initialization" makes more sense for this.

Cheers -ben

On Sun, Nov 12, 2017 at 2:31 AM, Cyril Ferlicot <[hidden email]> wrote:
Hi,

Torsten is doing a really cool job by cleaning the protocols of Pharo.

Smalltalk has a lot of conventions and if we want the users to apply
them we need to have a clean Pharo.

On that subject I was wondering…

Do we have a real convention for "reset" methods?

With this script:

((RPackageOrganizer default packages flatCollect: #methods) select: [
:each | each selector = #reset ]) collect: #protocol as: Bag

We can see that there is different way to do.

25 in accessing
11 in initialization
10 in positioning
10 in instance creation
And some others less popular choices.

So my question is, should we have a conventional protocol for reset methods?

For now, most of them are in "accessing", but it cause a violation of
the RBUnaryAccessingMethodWithoutReturnRule.

Personally I think that "initialization" protocol make the more sens.

If the community agree on it we could
- Recategorize
- Make sure the automatic categorizer follow the convention
- Add a rule/test to check that

Waiting for your thoughts :)

--
Cyril Ferlicot
https://ferlicot.fr

http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France