Should I use a class of functions or a namespace of functions?
<p>Say I want some functions to deal with some file, and I was considering 2 options.</p>

<p>1) Create a class like <code>SavedDataHandler</code> that a user could use like this....</p>

<pre><code>// Note that SavedDataHandler has no members. It just has functions that operate on a
// resource ( the file)
SavedDataHandler gameSave;
gameSave.SaveData( arg1, arg2 ); // to save data
gameSave.DeleteSave(); // Delete the save
...
</code></pre>

<p>2) Create a namespace of functions</p>

<pre><code>namespace SavedDataHandler {
  SaveData( ... ) { ... }
  DeleteSave( ... ) { ... }
  ...
}
</code></pre>

<p>that a user would call like </p>

<pre><code>SavedDataHandler::SaveData( arg1, arg 2 );
SavedDataHandler::DeleteSave();
</code></pre>

<p>What would be preferred? </p>

<p>P.S. I thought about this when I was thinking about Scott Meyer's recommendation to prefer non-member non-friend functions to member functions. I've run into decisions where I have a function (usually some private member function to help the class do stuff), that could easily be made into a non-member since it doesn't operate on class privates. </p>

<p>However, the function is only used by that one class. Of course, the program might evolve to a point where another class may need it, but I find it hard to find a place for these non-member functions. It's easy when you have a lot of functions with a general purpose, but I find single non-member functions hard to organize into a specific place, and find that leaving it as a member keeps things clean. Any tips regarding this issue?</p>
