title: Is returning early from a function more elegant than an if statement?
body: <p>Myself and a colleague have a dispute about which of the following is more elegant. I won't say who's who, so it is impartial. Which is more elegant?</p>
  
  <pre><code>public function set hitZone(target:DisplayObject):void
          {
              if(_hitZone != target)
              {
                  _hitZone.removeEventListener(MouseEvent.ROLL_OVER, onBtOver);
                  _hitZone.removeEventListener(MouseEvent.ROLL_OUT, onBtOut);
                  _hitZone.removeEventListener(MouseEvent.MOUSE_DOWN, onBtDown);
  
                  _hitZone = target;
  
                  _hitZone.addEventListener(MouseEvent.ROLL_OVER, onBtOver, false, 0, true);
                  _hitZone.addEventListener(MouseEvent.ROLL_OUT, onBtOut, false, 0, true);
                  _hitZone.addEventListener(MouseEvent.MOUSE_DOWN, onBtDown, false, 0, true);
              }
          }
  </code></pre>
  
  <p>...or...</p>
  
  <pre><code>public function set hitZone(target:DisplayObject):void
          {
              if(_hitZone == target)return;
  
              _hitZone.removeEventListener(MouseEvent.ROLL_OVER, onBtOver);
              _hitZone.removeEventListener(MouseEvent.ROLL_OUT, onBtOut);
              _hitZone.removeEventListener(MouseEvent.MOUSE_DOWN, onBtDown);
  
              _hitZone = target;
  
              _hitZone.addEventListener(MouseEvent.ROLL_OVER, onBtOver, false, 0, true);
              _hitZone.addEventListener(MouseEvent.ROLL_OUT, onBtOut, false, 0, true);
              _hitZone.addEventListener(MouseEvent.MOUSE_DOWN, onBtDown, false, 0, true);
  
          }
  </code></pre>