News for hackers. Stuff that matters.
Re:Comparing Elixir and Go by IanCal on Friday January 27, 2017 @06:03AM (#13499040)
This could be true in some restricted cases, but can't be in general.

If the username came from the database, it's going to be stored in memory before this function is called, and so concatenating must require building a new string.

Re:Comparing Elixir and Go by coldtea on Friday January 27, 2017 @06:49AM (#13499191)
It can require building a new string. But what is argued is that it wont require building several new strings incrementally for each concatenation.

E.g. no:

A + B + C + D -> AB + C + D -> ABC + D -> ABCD

And for immutable strings, it might not even require to build a new string at all, even if the string is in memory: it can just use a string data structure pointing to the various parts.

(