<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Oct 26, 2016, at 11:54 AM, Haravikk via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class=""><div class=""><br class="">
</div>
<div class="">Bottom line, most developers know the ternary expression if they come from C, C++, Obj-C, Java, C# (The list goes on). Why does Swift need to be different for style reasons. We will be making a niche language, because what you learn isn’t portable to another
language like it is if you learn Java, then get a job programming in C#.</div></div></div></blockquote><br class=""></div><div class="">While I agree on most of this, I think there is reasonable justification to discuss this on the basis of it using the question-mark; Swift uses the question mark extensively for handling of optionals, so there is an element of confusion present there, it also uses the colon in a somewhat unfamiliar way as well, so it's a twofold oddity in Swift.</div><div class=""><br class=""></div><div class="">That said, I'm not sure replacing it with a function is superior; this is something you can do yourself easily enough if you feel you need to, and which learners can likewise do if they don't know about, or don't like the operator.</div><div class=""><br class=""></div><div class="">So the question really is whether there's an alternative that is similarly concise, and on that I'm not so sure, so I'd lean towards leaving it as it is, but advising people to be careful about where they use it, as its very advantage in size can be a disadvantage in readability, so it should be used with care at all times.</div></div></div></blockquote><br class=""></div><div>I’ll add a couple of more points:</div><div><br class=""></div><div>1. This was extensively discussed in the Swift 3 release cycle, in multiple threads, and never went anywhere.</div><div>2. Changing this in Swift 4 is extremely unlikely even if there is a good answer, because - unlike in Swift 3 timeframe - any change that breaks source code needs extreme justification of why it is the right long term thing to do. I can’t fathom a rationale for this in the case of the ?: operator. Merely being potentially confusing is not enough.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>