title: Why does everyone use 2^n numbers for allocation? -> new StringBuilder(256)
body: <p>15 years ago, while programming with Pascal, I understood why to use power of two's for memory allocation. But this still seems to be state-of-the-art.</p>
  
  <p>C# Examples:</p>
  
  <pre><code>new StringBuilder(256);
  new byte[1024];
  int bufferSize = 1 &lt;&lt; 12;
  </code></pre>
  
  <p>I still see this thousands of times, I use this myself and I'm still questioning:  </p>
  
  <p>Do we need this in modern programming languages and modern hardware?<br>
  I guess its good practice, but what's the reason?  </p>
  
  <p><strong>EDIT</strong><br>
  For example a <code>byte[]</code> array, as stated by answers here, a power of 2 will make no sense: the array itself will use 16 bytes (?), so does it make sense to use 240 (=256-16) for the size to fit a total of 256 bytes?</p>