title: Is it ok to keep simple C++ method definitions inside of a header file?
body: <p>I've put all of my classes into separate header files. So I have a file named <code>snake</code> for the <code>Snake</code> class and a <code>fruit</code> file for a <code>Fruit</code> class etc. I'm familiar with the concept of using a header file for declaring a class and its methods and then defining the methods in a separate <code>.cpp</code> file with the same name. All of that makes sense to me and I've done that in the past.</p>
  <p>My question is: Is it considered a bad practice to implement the simplest methods inside the header file without a separate <code>.cpp</code> file? Or maybe I should put the whole class in the <code>.cpp</code> file instead?</p>
  <p>The reason why I'm asking this is that some of my classes only consist of 2 or maybe 3 <em>set</em> and <em>get</em> member functions and I don't see a point in creating a separate file for less than 10 lines of code. In fact I believe it would make my code unnecessarily complicated. I looked online and some people say it's fine, others say it's not.</p>