Concat/appending lists

In 99% of the code I write performance is not important so I just use whichever is more expressive for the data I have. For example, compile-time list concatenation? Hell yeah use ++.

However, I believe many general libraries (and the enum module itself in some list building methods) take a prepend then reverse strategy. You’ll see that if you search for Enum.reverse in the elixir code.

1 Like