Why did we make this change? Ah, you mean
Talking about naming, I would have preferred
sqrt. With an IDE like Xcode, tapping s-q-r-t would still allow auto-completion to the readable form of
With those old C names like
sqrt, you can't tell if it's a mutable or non-mutable function, and you wouldn't know how to name the counterpart. Are we going to have a
formSqrt for instance as a mutable version of the same function?
For free functions, there are no
mutating variants, so this isn't an issue. For the implementation hooks (statics), there is again no way to have a
mutating version. I.e., these new operations appear either as
Float.sqrt(x). There's no way either of those can be mutating, so no confusion is possible.
Even the existing method
x.formSquareRoot( ) was probably ill-considered because it doesn't offer any efficiency wins, but everyone was quite gung-ho about testing out the edges of the naming conventions at that point. It's a vestigial curiosity now that we might deprecate at some future point.