News for hackers. Stuff that matters.
Re:Annoyances of API Design by mikeash on Thursday January 28, 2016 @06:07PM (#10992241)
It's OK, but I wouldn't call it great. It's readable, but sort of hard to use. The trouble is that the interface is too flexible, more so than the underlying code, and so it's hard to know which combinations of parameters are legal. If you ask for a disallowed combination, you just get nil back and no explanation.

Edit: wrong API! This one does have a pixel format object.

It also tries to be helpful and so doesn't require all parameters. If you don't give it a data pointer, it will allocate memory for you. If you don't give it bytesPerRow, it will calculate it for you. These ought to be separate calls, not all glued together into one gigantic do-everything call.

The verbosity itself is fine, but it's symptomatic of some suboptimal API design behind it.

Re:Annoyances of API Design by rbritton on Friday January 29, 2016 @12:39AM (#10993706)
Though it's a C API, CGBitmapContextCreate is notorious for this.

While it doesn't address everything you're alluding to, I'm a big fan of Swift's nonnull/nullable making its way into Objective-C since some of Apple's APIs don't play well with a nil parameter (e.g., -[NSString isEqualToString:]).