title: Splitting long text into multiple lines of code, best way to do it?
body: <p>Imagine that you want to display a welcome message to a game but are required to keep the lines in the source code at a maximum length of 80 characters width. In the game the length of the lines are of no importance. An example of the welcome message would be:</p>
  
  <pre><code>private void welcomeMessage() {
      System.out.println("Welcome to the game. This message should learn me how to create a long messages like this in a read-able fashion. Imagine there is a limit of 80 characters per line for a programmer to see. How to fix this efficiently? This is one large line in my IDEA. ");
  }
  </code></pre>
  
  <p>This line is way too long for it to be 80 characters per line of code, as you can see by the scroll bar. I previously learned to simply do something like this:</p>
  
  <pre><code>private void welcomeMessage() {
      System.out.println("Welcome to the game. This message should learn me" +
              " how to create a long messages like this in a read-able " +
              "fashion. Imagine there is a limit of 80 characters per line for" +
              " a programmer to see. How to fix this efficiently? This is one " +
              "large line in my IDEA. ");
  }
  </code></pre>
  
  <p>However I find this solution ugly, this creates a dependency which is so annoying. If I add to <code>"Welcome to the game. This message should learn me"</code> just one word I have to change all the other lines, so all lines after a line depends on it. </p>
  
  <p>I can also imagine there are penalties just for making it readable in this way. It makes me wonder:</p>
  
  <ol>
  <li>Does the compiler append all lines directly since they themselves do not depend on other variables or does it happen at runtime? (I am afraid that it would call the concatenation operator function ('+') 4 times)</li>
  <li>Would a StringBuffer with .append() be more efficient in this example because it does not create 5 strings but instead appends it to the StringBuilder object? </li>
  </ol>
  
  <p>Imagine this was a real game, would you then just make a txt text file and import it with a StringBuffer etc. to display it on the screen? Or how else would you display longer text messages?</p>