title: Is generic programming ever necessary?
body: <p>I'm reading <a href="http://books.google.com/books?vid=ISBN0321811909" rel="nofollow">this book</a>, and it's going over static typing, which, after reading the chapter a little bit, I understand as:</p>
  
  <ul>
  <li>Static typing in OOP is defined as explicitly declaring the class an object is an instance of, so that it is predetermined (at compile time, before runtime i.e. <code>Foo var</code>).</li>
  <li>The opposite of this is generic programming, where the actual id of the object is yet-to-be-determined (i.e. <code>id var</code>).</li>
  <li>Something to keep in mind is that static typing is never necessary (straight from the book), it only improves readability, and eases the debugging process by showing what an object can and cannot do, what it can “see”.</li>
  <li>Generic programming, however, is sometimes necessary for things like arrays, where you might need...<strong>And this is where I'm confused. Is it actually <em>necessary?</em></strong></li>
  </ul>
  
  <p>I know that in Java you can enforce the type of objects contained in an array like: <code>ArrayList&lt;Double&gt;</code>, but in Objective-C, and I've done minimal research on this, there is no such method, and therefore, all <code>NSArray</code>s contain <code>id</code>s at compile time.</p>
  
  <p>If this feature (strangely called generics, even though it's static typing and not generic typing), is unavailable in Objective-C, does that mean that generic programming is sometimes necessary?</p>