title: C++ Style Convention: Parameter Names within Class Declaration
body: <p>I'm a fairly new C++ programmer and I would like to hear the arguments for and against naming parameters within the class declaration.</p>
  
  <hr>
  
  <p>Here's an example:</p>
  
  <p><em>Student.h</em></p>
  
  <pre><code>#ifndef STUDENT_H_
  #define STUDENT_H_
  
  #include &lt;string&gt;
  
  using namespace std;
  
  class Student
  {
      private:
          string name;
          unsigned int age;
          float height, GPA;
  
      public:
          Student(string, unsigned int, float, float);
  
          void setAge(unsigned int);
  };
  
  #endif /*STUDENT_H_*/
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>#ifndef STUDENT_H_
  #define STUDENT_H_
  
  #include &lt;string&gt;
  
  class Student
  {
      private:
          string name;
          unsigned int age;
          float height, GPA;
  
      public:
          Student(string name, unsigned int age, float height, float GPA);
  
          void setAge(unsigned int age);
  };
  
  #endif /*STUDENT_H_*/
  </code></pre>
  
  <p><em>Student.cpp</em></p>
  
  <pre><code>#include "Student.h"
  
  Student::Student(   string name,
              unsigned int age,
              float height,
              float GPA) :
  
              name(name),
              age(age),
              height(height),
              GPA(GPA) {}
  
  void Student::setAge(unsigned int age) { this -&gt; age = age; }
  </code></pre>
  
  <hr>
  
  <p>I cannot decide.  On the one hand, I feel that it is redundant to name the variables in both the declaration (<em>.h</em>) and the definition (<em>.cpp</em>).  Especially since you have to worry about updating the names in both places so that they match.  On the other hand, without names, it can often be confusing to determine what variables the parameters correspond to just by looking at the declaration.</p>
  
  <p>So, what are your thoughts?</p>