I recall getting a scolding for concatenating Strings in Python once upon a time. I was told that it is more efficient to create an List of Strings in Python and join them later
I was just reading about this. Attahced is a link talking about it.
Building-a-String-from-Parts
From what I understand, in Python and Java strings are immutable objects unlike arrays, while in Ruby both strings and arrays are as mutable as each other. There might be a minimal difference in speed between using a String.concat or << method to form a string versus Array.join but it doesn't seem to be a big issue.
I think the link will explain this a lot better than i did.
Thanks,
Martin