Thank you, Jeremy, this answer was very helpful, I can't wait to try out building my gem in this way :)
On Tuesday, August 4, 2015 at 6:57:20 PM UTC+2, Jeremy Evans wrote: > > On Tuesday, August 4, 2015 at 8:11:13 AM UTC-7, Janko Marohnić wrote: >> >> Hi Jeremy, >> >> This is kind of general question about the plugin system (which I figured >> Sequel first invented), as I would like to try applying the same system to >> one of the gems I'm building, because it's just a perfect balance between >> simplicity and features (you choose the level of complexity that you want, >> instant win). >> >> The concern I have with the plugin system are method name clashes. I'm >> not so concerned with public methods, but for me it seems that you can >> easily have method name clashes in the private section of your methods, >> since I feel people name these "less carefully" than the public section, >> and there are usually decent number of private methods in a well-refactored >> module. >> >> I just wanted to ask you, did you ever have problems with it, that you >> accidentally name two methods in different plugins the same, and that it >> takes you time to debug it? Do you avoid it by trying not to have to many >> methods? >> > > Janko, > > Name clashes are definitely a potential issue, since everything ends up in > the same namespace. However, I can't remember ever having an actual > problem due to a name clash. > > I don't think this is a big problem for Sequel itself, since it's easy to > keep track of all of the methods that are used in the plugins that ship > with Sequel. But it could potentially be an issue if you are loading > multiple external plugins which may not know about each other. However, I > also haven't heard of anyone having such an issue using external plugins. > > In terms of costs and benefits, I think the simplicity benefit of having > everything in the same namespace outweighs the cost of potential name > clashes. > > I certainly recommend giving due thought when choosing method names, since > it's hard to change them once they are in use. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
