Thanks to all three for your answers.

Cheers,
Alexandre


On 19 Aug 2009, at 14:55, [email protected] wrote:

> Alexandre,
>
> There are lots of more less similar guidelines, but I think is does  
> not apply to this case as I see it more or less like when you ask  
> for removing of an item of a collection.
>
> In your particular example a point could be taken on whether is  
> better to return false or nil. To me nil seems more like to an  
> object (a Symbol in your example) than using false which I would  
> expect of a isSomething method.
>
> HTH
>
> Em 19/08/2009 15:29, Alexandre Bergel < [email protected] >  
> escreveu:
>
>
> Dear List,
>
> Consider the following method:
> -=-=-=-=-=-=-=-=-=-=-=-=
> AClass>>aMethod
> ^ self compute
> ifTrue: [ #aSelector ]
> ifFalse: [ false ]
> -=-=-=-=-=-=-=-=-=-=-=-=
> I read somewhere that having a method that may return different type
> of values is not of a good style. I first through it was in Kent's
> book, but I cannot find it.
> Is there a book that talk about this coding style?
>
> Cheers,
> Alexandre
> -- 
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project<  
> br />
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to