6 ms·
Side note: For anyone interested, the third picture down[1] in the article is a fairly high resolution photo of a computer monitor where you can see Xcode and s
by princekolt 8y ago
Side note: For anyone interested, the third picture down[1] in the article is a fairly high resolution photo of a computer monitor where you can see Xcode and some very neat Objective-C code.
[1]: https://static01.nyt.com/images/2018/09/25/business/25INSTAGRAM04/merlin_45856561_88d6defc-30be-44f9-acf5-9aef8849cb09-superJumbo.jpg?quality=100&auto=webp https://static01.nyt.com/images/2018/09/25/business/25INSTAG...
- leothekim 8y agoHeh. The "shouldShowAlertForRequest" function is checking if a userInfo.message key equaling "Not authorized to view user". I would have expected something a little less dependent on a string isEqual check against an English phrase.
- weavie 8y agoBut, admit it - we've all been there at some point.
- dmix 8y agoUsually due to some "lesser of evil" solution as a result of some UI or system library, which in this case might be handling the alerts.
- quickthrower2 8y agoMore than one point
- mhh__ 8y agoIf it comes to something like that, I try to abstract it as much as possible (1. For my own soul, 2. Practicality) so it can be fixed with a drop in. Still end up writing a slightly nihilistc/suicidal commit message for the addition...
- wruza 8y agoASIHTTPRequest is one of those libraries that seem cool and easy, but lack a formal description on how to handle non-succesful paths. It likely just ends up there with generic error, and there is no way to check for a specific condition unless you use [isEqual:] on one of non-standard userInfo keys you found experimentally. Moreover, that string could go from a server error response, not from a request library. It is all text down the way due to how web is designed. Nothing here that would not pass a review, I think.
- abkumar 8y agoI wonder when this picture was taken. The iPhone design in the simulator, the old Gmail favicon, the old OS X scrollbars all indicate this being several years old. Wouldn't be surprised if this code has been rewritten multiple times since.
- kraig 8y agonot to mention the hipstamatic'esq picture
- vlozko 8y agoASIHTTPRequest? Yep, this is ancient.
- aaaaaaaaaab 8y agoTheir code is using manual reference counting so it must have been taken before ARC was introduced on WWDC 2011.
- arcticbull 8y agoNot necessarily; for the same reason many companies haven't jumped on Swift (specifically, not wanting to run all your hundreds of thousands of lines of code through a potentially buggy translator all the time), people didn't immediately jump onto ARC either. If I recall, that migration was far from painless. I remember some serious regressions introduced when I bit that bullet. Since all your code changed at once, tracking it down was hardly entertaining. IMO could have been anywhere from 2012 to 2013... This code also appears not to be using automatically synthesized properties. On the left screen, they're directly accessing Ivars and their Ivars have trailing underscores rather than leading (the default when synthesized). I suppose they could be doing this anyways, though it wouldn't exactly be standard industry practice. On the right Xcode screen, though, the code does use property syntax, so potentially ARC, although one doesn't imply the other.
- arcticbull 8y agoLet's see - the Simulator is running, at the latest, iOS 6. As such it was probably taken before iOS 7 GM (September 18, 2013). Based on the scroll tracks on Xcode, it also looks like it was running Snow Leopard; Lion was released in Mid-2011, so maybe even earlier. Between iOS and macOS, and given the acquisition was in 2012, I'd imagine these photos were taken around then.
- riazrizvi 8y agoYou mean how the code is indented after the if() { ?? What’s neat about it?