Convention for "reset" methods
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
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
+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 <cyril.ferlicot@gmail.com> 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
participants (3)
-
Ben Coman -
Cyril Ferlicot -
Sean P. DeNigris