Protocol naming

Chiming in because I was mentioned. Personally, I would never use either of those kinds of names. They describe a function signature or property type that is fully encoded in the type system (“returns a Something”), rather than anything that adds cognitive value for a reader above and beyond the declaration itself. Names should always add value that is not implied by other program elements.

@Gero's rephrasing of “what something is” doesn't really resonate for me. To me, “do stuff with (or to)” sounds like capability. I view “what something is” as a taxonomic classification, as in zoology/biology: is this thing animal, vegetable, or mineral? An animal? OK, more specifically, is it a mammal, insect, marsupial, bird… etc. It's a question that goes to the type's fundamental nature. Most types don't/shouldn't have multiple fundamental natures ("it's a floor wax! No, it's a dessert topping!"). When you come up with a “what something is” name like this, it helps explain to a reader the roles the type can play in a larger context: in the context of architectural elements, it's a support element, or a decorative element, or a door, or a window, or a room.

Capabilities generally apply across many different categories of things, like "can fly," or "has a color," and say less about a thing's role, and more about its discernible attributes.

HTH,
Dave

7 Likes