title: good coding practice - writing multiple commands in one line of code c#
body: <p>I want to create a string pattern which would require me to write 2 lines of code:</p>
  
  <pre><code>string linePattern = "|";
  for (int i = 0; i &lt; columns; i++) linePattern += "{" + i + ",-" + sizes[i] + "}|";
  </code></pre>
  
  <p>would it now be considered a good or a bad practice to write that in one line to see what the string is made of easier:</p>
  
  <pre><code>string linePattern = "|"; for (int i=0; i&lt;columns; i++) linePattern += "{"+i+",-"+sizes[i]+ "}|";
  </code></pre>
  
  <p>final string would be for example:</p>
  
  <pre><code>"|{0,-4}|{1,-2}|{2,-7}|{3,-3}|{4,-8}|";
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Reason for this question is, that variable declaration and assignment in two separate lines is incredibly ugly from my point of view. Is there another way to write this string that would be considered good practice? (note that this pattern might have to be extended based on the amount of columns)</p>
  
  <pre><code>string linePattern = /* string generator here */;
  
  echo("linePattern = |{0,-4}|{1,-2}|{2,-7}|{3,-3}|{4,-8}| ");
  </code></pre>