Readability a=b=c or a=c; b=c;?
<p>I have a class which has a group of integers, say</p>

<pre><code>foo()
{
  int a;
  int b;
  int c;
  int d;
  ....
  string s;
}
</code></pre>

<p>Now the question is for the best readbility, the init() function for foo(), should it look like</p>

<pre><code>void init()
{
  a=b=c=d=1; //for some reason they are init to 1;
  s = "abc";
}
</code></pre>

<p>or</p>

<pre><code>void init()
{
  a=1;
  b=1;
  c=1;
  d=1;
  s = "abc";
}
</code></pre>

<p>?</p>

<p>The reason for a string in class is a hint of other groups of same types might present and of course, the class might grow as requirement changes</p>

<p>EDIT: before this question goes too far, the intention of this question was simple:
In Effective C++ item 12 (prefer initialization to assignment in constructors), Scott uses chain assignment instead of a=c; b=c; I am sure he knows when to use what, but I also remembered the books I read also recommended to use int a; int b; which in similar case of assignments. In my program I have a similar situation of a group of related individual build-in types needs to be initialized and I have found by making a chain assignment does makes it easier to read especially if the class have many other different types instance variables. It seems to contradict with books I read and my memory, hence the question.</p>
