4 ms·
runOnSentencesAsMethodNamesDidNotAppealToYou ?
by cloudjacker 10y ago
runOnSentencesAsMethodNamesDidNotAppealToYou ?
- 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.