title: Cost Analysis between the two enums in iOS
body: <p>I came across an enum definition :-</p>
  
  <pre><code>typedef enum NSInteger {
      kBorderTypeNone   = 0,
      kBorderTypeLeft   = 1 &lt;&lt; 0,
      kBorderTypeRight  = 1 &lt;&lt; 1,
      kBorderTypeTop    = 1 &lt;&lt; 2,
      kBorderTypeBottom = 1 &lt;&lt; 3
  } BorderType;
  </code></pre>
  
  <p>and also (possibly) it can be equivalent to </p>
  
  <pre><code>typedef enum NSInteger {
      kBorderTypeNone   = 0,
      kBorderTypeLeft   = 1 ,
      kBorderTypeRight  = 2,
      kBorderTypeTop    = 4,
      kBorderTypeBottom = 8
  } BorderType;
  </code></pre>
  
  <p>What are the internal differences(if any)?
  Is there any advantage of one over the other? 
  Which one is recommended?</p>
  
  <p><strong>Edit 1:</strong>
  If both are same then how compiler handles it? 
  In which phase of compiler is it reduced to same set of instructions? </p>