There’s nothing ugly or wrong in making a simple str1+" "+str2
. It can be used without problems. It is simple and efficient. It has no technical reasons to choose a shape, it is just style.
Although ugly depends on taste, I find any other ugly form, longer and even less intuitive when it strikes the eye fast. Pick one and be consistent, don’t keep changing the shape.
There could be problems if you make many concatenations within a loop, but even this JS optimizes, so up to the use of str += str2
is fitting in a loop.
Concatenate in what context? Pure and simple, two strings?
– Maniero
That’s all. It’s just that I started to think this is ugly: str1+" "+str2.
– user83428
@bigown I would know if there is any place on the site to post questions half out of scope like this?
– user83428
I wouldn’t say she’s out of scope, maybe too simple :) So it’s right here.
– Maniero