You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have seen that you change some methods to functions in some of your packages. What is the reason for that? Is there any drawback of S4 methods (except that dispatching needs some time and debugging is sometimes harder)?
The text was updated successfully, but these errors were encountered:
except that dispatching needs some time and debugging is sometimes harder
The time involved for dispatching is generally negligible. Debugging is however always (at least a bit) harder. One can make the method call an internal function to facilitate debugging, but that makes the general structure of the software harder to grasp.
But I think you've got the wrong end of the stick. The question is not 'why not use S4 methods' but 'why use S4 methods'. And, IMHO, the answer to that is because the functionality is used in many different places. This happens because the name is very generic (normalize, smooth, ...) and/or used in many different context (plot, ...). When none of these apply, I am questioning the need for a generic/method. This is also valid for most of the accessors and replacement functions, which can be implemented as functions, and I don't see why generics/methods are more appropriate.
@sgibb commented
The text was updated successfully, but these errors were encountered: