title: Dictionary Direct access vs TryGetValue
body: <p>I have a dictionary which maps strings to objects like this:
  <code>Dictionary&lt;string, object&gt; myDic;</code></p>
  
  <p>I know prior what the type of the object is based on the string, but my question is whether I should use TryGetValue, or direct lookups with try, catch statements.</p>
  
  <p>Example:</p>
  
  <pre><code>//TryGetValueMethod
  object myObject = null;
  myDic.TryGetValue("test", out myObject);
  
  MyCustomType t1 = (MyCustomType) myObject;
  
  //Direct lookup method
  try
  {
       MyCustomType t2 = (MyCustomType) myDic["test"];
       //Do something here...
  } catch {}
  </code></pre>
  
  <p>What method do you think is preferred? The second one is more clean coding because there are no extra castings, but i think it is less efficient than the first, because it is exception-free.</p>