<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=""><div><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box;" class="">What is your evaluation of the proposal?</li></ul></div></blockquote><div>-1. Like I said in my review of 167, this sort of core API is far too important for the implementation to be so flawed.</div><div><br class=""></div><div>* This proposal is extensive. An implementation playground would’ve been nice. Containers seem fairly odd, so it would’ve been nice to see how they feel in use.</div><div><br class=""></div><div>* Like 167, this proposal feels very Objective-C like. While we want interoperability with NSCoder and NSKeyedArchiver, this should be a native Swift solution first and a bridge second. Also, some bits of the API aren’t Swifty; any API which uses Type.self just doesn’t feel right. Please, use the generics.&nbsp;</div><div><br class=""></div><div>someString = try container.decode(forKey: .someString) can infer the type from the assignee, no?</div><div><br class=""></div><div>* This sort of API works well when the responses are logically formed, but this also forms the basis of the APIs we’ll be using to interact with JSON, which can be anything but logically formed. For instance:</div><div><br class=""></div><div>struct Veritas {</div><div>&nbsp; &nbsp; let truth: Bool</div><div>}&nbsp;</div><div><br class=""></div><div>Simple, right?</div><div><br class=""></div><div>But say it’s JSON representation is this:</div><div><br class=""></div><div>{ “some_Bad_key” : “Yes” }</div><div><br class=""></div><div>How would this proposal let me transform a Yes string into the proper boolean value? There doesn’t seem to be a solution provided, just the brute force method of trying to decode as a string first and then transforming. Plus, if I have a single value that I need to do something custom to, I need implement init(from decoder:) for my entire type, so it becomes very painful very quickly. I foresee a new collection of open source libraries to remedy this shortcoming, and they really shouldn’t have to.</div><div><br class=""></div><div>Also, what if I wanted to be able to decode this type from both the terrible JSON and a nice on disk format? Some way to provide multiple conforming initializers would be nice.</div><div><br class=""></div><div>Suffice to say my biggest concern here is that this API is designed for the ideal and not the messy reality of JSON APIs created by the lowest bidder. Since this proposal is supposed to cover both, it needs to offer support for the worst case scenarios more easily.</div><div><br class=""></div><div>* The errors generated just aren’t good. I covered this in more detail in my review of 167, but suffice it to say they’re too limited by the desire to bridge them to NSErrors and don’t capture any useful details about what caused them in the first place. Also, they shouldn’t live in Foundation, as this is a feature the standard library will implement.&nbsp;</div><div><br class=""></div><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-top: 0.25em;" class="">Is the problem being addressed significant enough to warrant a change to Swift?</li></ul></div></blockquote><div>Yes, this is a problem worth solving, I just don’t think this proposal is good enough.</div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-top: 0.25em;" class="">Does this proposal fit well with the feel and direction of Swift?</li></ul></div></blockquote><div>No. Passing types around isn’t Swifty at all. This fits right in in Objective-C though.</div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-top: 0.25em;" class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li></ul></div></blockquote><div>I’ve been an Argo user for 2 years, so I’m used to a certain terseness and flexibility in my decoders. This proposal brings neither. Argo also has superior errors which capture the keys and types that caused an issue. I guarantee there will be at least one open source library which provides operators that wrap this proposal’s API so that you can properly transform decoded values without multiple lines of code.</div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-top: 0.25em;" class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul></div></blockquote></div>Multiple read throughs, about an hour of analysis.&nbsp;<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Jon Shier</div></body></html>