<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Either. But in general use ^self&nbsp; rather than ^nil<br>
so that it acts the same as the implicit ^self when you drop out the
end of a method.<br>
<br>
Bob Arning wrote:
<blockquote cite="mid:5267DBB3.6070303@comcast.net" type="cite">I
prefer the first - it gets one case out of the way quickly.
  <br>
  <br>
Cheers,
  <br>
Bob
  <br>
  <br>
On 10/23/13 10:12 AM, Louis LaBrunda wrote:
  <br>
  <blockquote type="cite">Hi,
    <br>
    <br>
I'm about to write a method where I need to test whether to do
something or
    <br>
just get out.&nbsp; What is the best practices way to do this?&nbsp; For example:
    <br>
    <br>
(a = b) ifTrue: [^nil].
    <br>
*The code that does the work*
    <br>
    <br>
or:
    <br>
    <br>
(a = b) ifFalse: [
    <br>
&nbsp;&nbsp;&nbsp; *The code that does the work*
    <br>
].
    <br>
    <br>
I think the second is better style but I have used both.&nbsp; Generally
using
    <br>
the first when *The code that does the work* is long and the second
when it
    <br>
is short.
    <br>
    <br>
Is there any speed difference between them?&nbsp; I doubt it but I thought I
    <br>
would ask anyway.
    <br>
    <br>
Lou
    <br>
-----------------------------------------------------------
    <br>
Louis LaBrunda
    <br>
Keystone Software Corp.
    <br>
SkypeMe <a class="moz-txt-link-freetext" href="callto://PhotonDemon">callto://PhotonDemon</a>
    <br>
<a class="moz-txt-link-freetext" href="mailto:Lou@Keystone-Software.com">mailto:Lou@Keystone-Software.com</a> <a class="moz-txt-link-freetext" href="http://www.Keystone-Software.com">http://www.Keystone-Software.com</a>
    <br>
    <br>
    <br>
    <br>
  </blockquote>
  <br>
  <br>
  <pre wrap="">
<hr size="4" width="90%">

  </pre>
</blockquote>
<br>
</body>
</html>