title: Why do so many programmers put curly braces on the same line as related keywords?
body: <p><em><strong>Note:</strong> I'm not sure if this is the right place for this. If another site suits this question better, please point me there. I was going to place it on cs.SE, but there was no tag about formatting, so I figured it didn't belong there, and this isn't actually runnable code, so I figure it doesn't belong on codereview.SE either.</em></p>
  
  <hr>
  
  <p>When I was first taught to program in Java in 2009, my teacher (and all the examples from the book) had the code formatted as such:</p>
  
  <pre><code>public void method()
  {
    if (condition)
    {
      doStuff();
    }
  }
  </code></pre>
  
  <p>However, in the field, I rarely, if ever, see it like that. Almost always, it's like this (whether or not it's Java code):</p>
  
  <pre><code>public void method() {
      if (condition) {
          doStuff();
      }
  }
  </code></pre>
  
  <p><strong>Why do so many programmers choose to put the curly braces on the end of a line instead of their own line?</strong> Is it to save scrolling length or file size? Perhaps it was the standard before my education? To me, it just makes it less clear whether we're entering a new block.</p>
  
  <p>Of course, I can chock up doing things like how many spaces to indent or adding spaces within parentheses, like <code>if ( condition )</code>, to personal preference, since it's not done nearly as often, but placing the brace at the end seems to happen way too often to just be personal preference.</p>