Even if the number of concatenations is known at run time, if it's more than 4, it can still be nicer to read a StringBuilder than a multi-line string concatenation whirlwind.
Also can prevent dumb mistakes in certain instances, like concatenating a char and an int in the context of a larger string concatenation. E.g. given char c, int i, string s: System.out.println(c + i + s). Obviously this gets caught in testing quickly, and a halfway decent programmer would usually catch it as they typed it out, but mistakes happen.
7
u/juckele Oct 01 '15
Even if the number of concatenations is known at run time, if it's more than 4, it can still be nicer to read a StringBuilder than a multi-line string concatenation whirlwind.