Could someone please kindly provide a summary of the benefits of using the following structure for plugins?
I've seen plugins that use it, and plugins that don't. Some plugins put some stuff outside of it, and others put the same stuff inside. What's the difference? If I'm overriding or aliasing the functions in the core files, does it matter whether I use the above structure or not?
Some plugins do weird things like this:
and I think I've seen some that do this:
What's that all about - what does it allow you to do? What's the significance of what I put in the ()?
I'm starting to write new plugins for my own game, which I may share here, and I'd like to get off on the right foot.
Code:
(function() {
// stuff goes here
})();
Some plugins do weird things like this:
Code:
(function(_) {
// stuff goes here
})(something);
Code:
(function($) { ...
I'm starting to write new plugins for my own game, which I may share here, and I'd like to get off on the right foot.

