[swift-evolution] Thoughts on clarity of Double and Float type names?

Janosch Hildebrand jnosh at jnosh.com
Tue Jan 5 18:41:23 CST 2016


I also think that Float and Double are not ideal type names but I also agree with many of the concerns that have been raised.


Why not simply use (the existing) Float32 and Float64 while keeping everything else equal?

So as a first step we could encourage the use of Float32/Float64 over Float/Double:
Make Float/Double typealiases for Float32/Float64 instead of the reverse which is true today
Use Float32/Float64 in documentation and example code
Perhaps add a note to the documentation for Float/Double that the Float32/Float64 types should be preferred
...

This would not break any existing code and I think would be a positive change in the long term.
Also this might have a better chance to be accepted as a proposal and by the community at large.

Making Float32/Float64 the officially preferred types should still help their adoption a lot without the pains involved in removing Float/Double.

And the deprecation and eventual removal of Float/Double could still be considered separately either now or down the road if people actually adopt Float32/Float64. Also migration would be very simple in this case (and stragglers could simply create their own Float/Double typealiases).


- Janosch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160106/47f554f9/attachment.html>


More information about the swift-evolution mailing list