title: Exception vs. if statements
body: <p>I have 2 pieces of code. What would say is best practice and why?
  In the first version I add a new shop and evaluate if it's successful with Exceptions, and in the second version I do the same with "if" statements. </p>
  
  <p>I've recently read that Exceptions can be expensive in the code, and if all "Add" method is implemented this way it can cause performance issues.
  Can anybody confirm this?</p>
  
  <p>Thanks!!!</p>
  
  <pre><code>public bool AddShop1(Shop newShop)
          {
              try
              {
                  ShopDictionary.Add(newShop.ShopId, newShop);
                  return true;
              }
  
              catch (ArgumentNullException)
              {
                  return false;
              }
  
              catch (ArgumentException)
              {
                  return false;
              }
  
          }
  
  public bool AddShop2(Shop newShop)
          {
              if (newShop == null || ShopDictionary.ContainsKey(newShop.ShopId))
              {
                  return false;
              }
  
              ShopDictionary.Add(newShop.ShopId, newShop);
              return true;
          }
  </code></pre>