There isn't much difference between this: "My name is #{name} and surname is #{surname}"
and this: "My name is " + name + " and surname is " + surname
or this: fmt.Println("My name is %s and surname is %s", name, surname)
Except the first one is much more readable.String interpolation seems like a small thing, but I find myself wanting to use it all the time. It's definitely not a "magic" feature. Javascript really needs it as well. |
I disagree, especially in the presence of syntax highlighting editors.
String interpolation would be a redundant alternative to existing mechanisms (the above plus text/template for longer strings) and just make parsing more complex. I don't think it would fit in well with Go's philosophy of providing pleasant, minimalistic syntax.