title: Polluting the global namespace
body: <p>I think most C++ programmers here would agree that polluting the global namespace is a bad idea, but are there times when this rule can be ignored?</p>
  
  <p>For example, I have a type that I need to use all over a particular application - should I define it thus:</p>
  
  <pre><code>mytypes.h
  
  typedef int MY_TYPE;
  
  foo.cpp
  
  MY_TYPE myType;
  </code></pre>
  
  <p>Or use a namespace:</p>
  
  <pre><code>mytypes.h
  
  namespace ns {
  typedef int MY_TYPE;
  }
  
  foo.cpp
  
  ns::MY_TYPE myType;
  ...
  using namespace ns;
  MY_TYPE myType;
  </code></pre>
  
  <p>Which do you prefer?  Are there times when it is acceptable to use the first method?</p>