2015-04-08 7:21 GMT-03:00 Esteban Lorenzano <[email protected]>: > > On 08 Apr 2015, at 12:01, Peter Uhnák <[email protected]> wrote: > > On Wed, Apr 8, 2015 at 11:52 AM, Esteban Lorenzano <[email protected]> > wrote: >> >> >> > On 08 Apr 2015, at 11:37, Yuriy Tymchuk <[email protected]> wrote: >> > >> > Sometimes I use #new >> that’s horrible! >> completely misleading > > > I'm curious, if it is singleton, should you worry from outside about the > fact that it is a singleton? Shouldn't that be hidden from the user? > > nope. > new means new. > you are confusing your user if you send a new message and you receive an > already existing (aka not new) object. > the literature existing always recommend to use an specific method (usually > #instance or #uniqueInstance, in smalltalk.. who decided to use > #uniqueInstance as a convention).
+1 I like #current as the selector, because most of the times I use singleton as a globally accessible object. And as with any global reference it is good practice to avoid them as much as possible. Regards! Esteban A. Maringolo
