Re:Making a Go program 70% faster by avoiding common mistakes
by sspiff on Thursday March 17, 2016 @08:54AM
(#11304006)
> The first one is only necessary in languages where functions can have side effects
To be more precise, it is only necessary in language where all functions can have side effects. Some language (like D) have the ability to mark a function as "pure" (without side effects), which allow the compiler to perform additional optimizations (and purity validation).
In most cases you would of course still name the result yourself, as to indicate that the function call indeed is the same. However for something very semantic, such as `sum(list)`, maybe the only name you could give it, would be something like `list_sum` anyway.