"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.
It works really well in its current form, that is probably the general consensous.
> additional features are a source of evil
Some of us have walked down that path before (e.g. Perl, Scala) and think we have seen the light (or at least the darkness).
> up until the day when they are added, in which case they are suddenly evidence of the language's superiority
That sounded very much like flamebait. Could you name an example of a feature added to Go that was previously considered evil and then as evidence of Go's superiority?
Every syntax highlighter in an editor I've seen for Ruby handle highlighting string interpolation just fine.
I definitely don't have a problem with the Go developers keeping out random syntax additions unless they think its a really good idea.
Along the same lines, I really miss not having `map`, `reduce`, and `filter` in Go. However, it doesn't seem like those would be efficient in Go, or that they fit in with as well with systems programming, which Go was designed for. So I can't hate them for not including these.
map, reduce, filter, etc will be easy to code up once there are generics. There will almost certainly be generics in Go at some point, that point is just not right now (and almost certainly not before 2.0).
What is the Go best practise for i18n? A google search seems to provide various solutions but not one best practise.
> the third has ordering issues
In Go you can specify the order in format strings: fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
I do this unfortunately way more than I want to admit...
This only leaves us console programs and backdoors. I'm happy to give these two up for a stronger language.
I don't think such a micro-optimisation is enough to sway the argument though.