Formatted string is clearer than adding strings, especially when you have more than two parameters.
static readonly string UrlFormat = "{0}://{1}/{2}?{3}"; //the format can be reused
var url = string.Format(UrlFormat, scheme, host, path, query);
var anotherUrl = string.Format(UrlFormat, scheme2, host2, path2, query2);
var bad = scheme3 + "://" + host3 + "/" + path3 + "?" + query3;
By the way in C#6 the format can be more pretty:
var urlUsingNewFeature = $"{scheme}://{host}/{path}?{query}";
You can see the maintenance cost between them.
The performance The only advantage of adding strings is that when you adding two strings, it's faster than string formatting.
"Student Name: " + name
is a little faster than
string.Format("Student Name: {0}", name)
I did the benchmark before, adding <=3 strings is faster than using string.Format
. But IMO you still should use string.Format
, the tiny performance improvement is not that important.