4 ms·
Apple has publically recommended Objective-C code to not call Swift libraries, but rather advises Swift calling Swift frameworks or Swift calling Objective-C fr
by guessbest 10y ago
Apple has publically recommended Objective-C code to not call Swift libraries, but rather advises Swift calling Swift frameworks or Swift calling Objective-C frameworks.
- Cyph0n 10y agoAh, I see. That makes sense.
- pducks32 10y agoOh I didn't know that. It still seems weird. Objective-C has always been hard for me to read and yet I love reading code—especially Apple's—so I guess the struggle will continue. Even if that means I can't really contribute to this.
- cloudjacker 10y agorunOnSentencesAsMethodNamesDidNotAppealToYou ?
- sjwright 10y agoThat's the best bit, and makes reading blocks of code incredibly efficient. You can observe a method being called like [table allowsMultipleSelectionDuringEditing:YES] And even though you might not remember that UITableView method, once you read it you immediately know what it does, often saving you a round trip to the docs.
- cloudjacker 10y ago> often saving you a round trip to the docs that's optimistic those methods rarely do exactly what you think, they can be an overloaded version of another method and more frequently there is another method with a similar method name, or one is singular and one is plural and it becomes very inefficient because the method names look the same, the exact reason why the english language has spaces and punctuation to begin with
- sjwright 10y agoWell duh, obviously. They're not going to concatenate entire paragraphs of documentation into the method name. Like so many things it's a matter of degrees. If the method was called table.multiSel() then you'll be more likely to need to consult the docs. It's not optimistic in my experience. Much of the time when doing code review or bug hunting other people's code, it's less about knowing exactly what a particular method does, as much as being able to rapidly estimate your way to relevant areas. If nothing else, verbose names can make it faster to ignore irrelevant code.
- JakaJancar 10y agoWhere was that?