In Advanced R, there is a suggestion about avoiding brackets ({}
) in setGeneric()
:
It is bad practice to use
{}
in the generic as it triggers a special case that is more expensive, and generally best avoided.
I wonder if anyone has any detailed rationale about this suggestion. I searched it online and could not find any references except for this line in Advanced R 2nd ed. (it is not in the first edition, where brackets are used in the setGeneric()
examples).