- Joined
- Mar 16, 2012
- Messages
- 7,483
- Reaction score
- 11,620
- First Language
- Indonesian
- Primarily Uses
- N/A
About IIFE: https://developer.mozilla.org/en-US/docs/Glossary/IIFE
This morning, I had an interesting discussion from one of the discord chat (with @Aloe Guvner to give them some credit). Some brought up that it is not something to promote in MV plugin making. While I sort of understand, I didn't really voice my opinion on because I barely made anything in MV to understand that. However, that doesn't mean it isn't bothering my mind.
Generally, what I've seen is it is to avoid naming conflict. It encapsulated in a private block of function so your variable isn't accessible outside of it. But the question are
> How common is the name conflict?
> Can you just use your own name pattern like <yourname>_<scriptname>_<alias method name>? I don't believe if it will be too common to get conflict. Additionally, you can just use your own namespace (like how Yanfly did it)?
> Do you consider a plugin that doesn't do an IIFE is a kind of... heretic?
> So why even IIFE? Any other benefit that I don't know? Or other drawbacks (aside from the conflicting name)?
> Do you promote to some of the (potential) new plugin dev to use IIFE?
This morning, I had an interesting discussion from one of the discord chat (with @Aloe Guvner to give them some credit). Some brought up that it is not something to promote in MV plugin making. While I sort of understand, I didn't really voice my opinion on because I barely made anything in MV to understand that. However, that doesn't mean it isn't bothering my mind.
Generally, what I've seen is it is to avoid naming conflict. It encapsulated in a private block of function so your variable isn't accessible outside of it. But the question are
> How common is the name conflict?
> Can you just use your own name pattern like <yourname>_<scriptname>_<alias method name>? I don't believe if it will be too common to get conflict. Additionally, you can just use your own namespace (like how Yanfly did it)?
> Do you consider a plugin that doesn't do an IIFE is a kind of... heretic?
> So why even IIFE? Any other benefit that I don't know? Or other drawbacks (aside from the conflicting name)?
> Do you promote to some of the (potential) new plugin dev to use IIFE?