title: How to deal with the idea of "many small functions" for classes, without passing lots of parameters?
body: <p>Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables.</p>
  
  <p>Every additional helper function clutters up the interface, since often the code is class specific and I can't just use some generic piece of code. 
  (To my limited knowledge, anyway, still a beginner, don't know every library out there, etc.)</p>
  
  <p>So in extreme cases, I usually create a helper class which becomes the friend of the class that needs to be operated on, so it has access to all the nonpublic guts.</p>
  
  <p>An alternative are free functions that need parameters, but even though premature optimization is evil, and I haven't actually profiled or disassembled it...
  I still DREAD the mere thought of passing all the stuff I need sometimes, even just as reference, even though that should be a simple address per argument.</p>
  
  <p>Is all this a matter of preference, or is there a widely used way of dealing with that kind of stuff?</p>
  
  <p>I know that trying to force stuff into patterns is a kind of anti pattern, but I am concerned about code sharing and standards, and I want to get stuff at least fairly non painful for other people to read.</p>
  
  <p>So, how do you guys deal with that?</p>
  
  <p>Edit:
  Some examples that motivated me to ask this question:</p>
  
  <p>About the free functions:
  DeadMG was confused about making free functions work...without arguments.</p>
  
  <p>My issue with those functions is that unlike member functions, free functions only know about data, if you give it to them, unless global variables and the like are used.</p>
  
  <p>Sometimes, however, I have a huge, complicated procedure I want to break down for readability and understandings sake, but there are so many different variables which get used all over the place that passing all the data to free functions, which are agnostic to every bit of member data, looks simply nightmarish.
  <a href="http://i.stack.imgur.com/0zlbu.png" rel="nofollow">Click for an example</a></p>
  
  <p>That is a snippet of a function that converts data into a format that my mesh class accepts.
  It would take all of those parameter to refactor this into a "finalizeMesh" function, for example.
  At this point it's a part of a huge computer mesh data function, and bits of dimension info and sizes and scaling info is used all over the place, interwoven.</p>
  
  <p>That's what I mean with "free functions need too many parameters sometimes".</p>
  
  <p>I think it shows bad style, and not necessarily a symptom of being irrational per se, I hope :P.</p>
  
  <p>I'll try to clear things up more along the way, if necessary.</p>