title: C++ style for header files
body: <p>Suppose I have the following files:</p>
  
  <ol>
  <li>main.cpp</li>
  <li>routine.cpp</li>
  <li>routine.h</li>
  </ol>
  
  <p>Suppose further that main.cpp calls a function <code>routine()</code> that is defined in routine.cpp, but routine.cpp also contains functions that are <strong>only</strong> used by the <code>routine()</code> function.  In other words, routine.cpp contains both functions that are only called from within routine.cpp and functions that are called from other source files.</p>
  
  <p>Obviously main.cpp will contain <code>#include "routine.h"</code>.  But should routine.h contain prototypes of <strong>all</strong> functions that are defined in routine.cpp (style A), or should routine.h <strong>only</strong> contain prototypes of functions that are called from other source files (style B)?</p>
  
  <p>I've always written code after style A, but recently I've wondered if style B makes more sense stylistically.  (If style B is used, then the prototypes of the functions that are used only inside routine.cpp could be at the top of routine.cpp, or the definitions could simply precede their usage.)</p>