[squeak-dev] Best practices question

Louis LaBrunda Lou at Keystone-Software.com
Wed Oct 23 14:12:54 UTC 2013


Hi,

I'm about to write a method where I need to test whether to do something or
just get out.  What is the best practices way to do this?  For example:

(a = b) ifTrue: [^nil].
*The code that does the work*

or:

(a = b) ifFalse: [
   *The code that does the work*
].

I think the second is better style but I have used both.  Generally using
the first when *The code that does the work* is long and the second when it
is short.

Is there any speed difference between them?  I doubt it but I thought I
would ask anyway.

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com



More information about the Squeak-dev mailing list