I'm posting these questions mostly for discussion at NSCoderNight London this evening. But hey, maybe others will find them interesting to think about too.
- If you could go back in time and direct the Foundation team to do just a handful of APIs differently, what would you change? Make all strings mutable? Make NSArray a subclass of NSSet? Build in NSError earlier? Rethink KVO? Never bother with CoreFoundation? (I'm curious about APIs specifically – shipping blocks, ARC, or the modern runtime in 10.0 doesn't count!)
- If Apple supplied a framework functionality for communicating with FTP/SFTP etc. servers, how would you expect to interact with it as a developer?
Well, NSCoderNight is now over. I admit we never got onto much discussion of FTP/SFTP! But a variety of ideas were discussed for Foundation:
- Pieter wishes -copy… methods weren't a special case and were expected to return a +0 retain count object
- Richard and I fervently wish NSCopyObject had never shipped, and are sure anyone who's ever subclassed NSCell or one of its derivatives agrees!
- We also reckon NSZone should have been ditched in the transition from NeXTStep. I'd be curious to know if it would have made any significant difference back in those days to performance by cutting out one message send from each allocation
- Pieter and I would have liked to see the NSURL vs. paths debate settled much earlier
- Shipping NSError from day one would have made me very happy seeing as we still have APIs today which report failure but no more detail
- I proposed that NSURL could be a direct subclass of NSString, since all URLs are valid strings, but not visa versa. People were cautiously interested
- I also suggested that NSArray should be a direct subclass of NSSet, since all of NSSet's API reasonably applies to arrays and there are times when that would have been handy. Everybody else was disgusted by this. Maybe I'll blog the idea in more depth someday
- And don't worry I definitely don't want to see all strings be mutable; it was just a suggestion to rile people up
All in all, the shortness of this list says to me that the Foundation team should be damn proud of themselves.
Did I miss any or you weren't present tonight to yell at me? Message me on Twitter.