Re:Conceptual Debt Is Worse Than Technical Debt
by geofft on Friday January 01, 2016 @08:58PM
(#10824581)
I parsed saurik's comment as a joke based on Objective-C enjoying long names containing the word "with". Objective-C is relatively unique among programming languages in continuing the method name when specifying parameters, and "with" is a usual way of specifying them. For instance, one of the constructors for NSString is named "stringWithContentsOfFile:encoding:error:", and the way you'd call that method is something like [NSString stringWithContentsOfFile:@"file.txt" encoding:NSUTF8StringEncoding error:NULL].
However, in this context it's not used that way, because you're not taking an OperationApplicationException. Instead, yes, this appears to be a variant of readExceptionFromParcel that instead sometimes throws an OperationApplicationException. That use of the word "with" would not feel correct in Objective-C -- nor would the use of an exception, probably, since they are rarely used in Objective-C.
Re:Conceptual Debt Is Worse Than Technical Debt
by HillaryBriss on Saturday January 02, 2016 @05:40PM
(#10828347)
Ah. I just wasn't able to understand saurik's joke. Thank you for clarifying these things. Good stuff.
Is there a method naming convention in Objective-C where the phrase "withExceptionXYZ" in the method declaration means "this method may throw an instance of ExceptionXYZ"?
This is from https://android.googlesource.com/platform/frameworks/base/+/... :
I don't know Objective-C at all. Would this method name truly feel correct in that language?Thanks.