Swift range operators too easy to mis-type
| Originator: | kusterer | ||
| Number: | rdar://17203527 | Date Originated: | 06-Jun-2014 12:10 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6 |
| Classification: | Serious Bug | Reproducible: | Always |
Swift has two operators for specifying ranges, .. and … - as it is very easy to miss a keypress on the keyboard or trigger a key twice due to bounce-back of the physical keyobard keys, this can lead to hard-to-detect bugs where a large array is iterated, but the last element is missed, which can lead to creeping loss of data. Instead, it would be better to make the two range operators more distinct. Also, Swift’s operators are reversed from that of other popular (and similar-looking) languages.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!