<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=""><blockquote type="cite" class="">On Oct 12, 2016, at 3:07 PM, Karl &lt;<a href="mailto:razielim@gmail.com" class="">razielim@gmail.com</a>&gt; wrote:<br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I disagree. I find the first better in a number of respects (although there are certainly things you could do to optimise legibility).</span><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Firstly, I can more clearly see all of the various file errors. I can easily see how many there are, which associated values they take, etc. That’s important when writing a switch statement, for instance.</div></div></blockquote><div><br class=""></div><div>Since the definitions of the properties are implementation details, the generated interface would collapse to the simple list of cases and their associated values, just as methods, dynamic properties, etc. currently do.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Secondly, related data is group together. All of the localised descriptions are together, etc.</div></div></blockquote><div><br class=""></div><div>I guess we disagree on this. To me, it is much clearer to have the description of each case grouped together, rather than all the localized descriptions. It’s also a lot less verbose, to my mind easier to read, and it also makes it a lot quicker to create new cases or delete unnecessary ones.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">In real code, things like localised descriptions will likely come from a common place - e.g. a localised string database.</div></div></blockquote><div><br class=""></div><div>The code shown was obviously simplified for the sake of example.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Third: types. You never defined the type of any of these computed properties.</div></div></blockquote><div><br class=""></div><div>The type of the “url” property that I added was defined at the top of the example. The rest of the properties are defined in LocalizedError, where their types are given.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">It’s a fun example, but personally I don’t find it convincing. Several of those values are closely related and could be grouped as a struct or tuple if brevity is so important. Do you really need separate “failureReason” and “recoverySuggestion” and “helpAnchor” properties?</div></div></blockquote><br class=""></div><div>Given that these properties are specified by the LocalizedError protocol, I’m gonna go with… yes.</div><div><br class=""></div><div>Charles</div><div><br class=""></div></body></html>