Let's share your beliefs in RMMV plugin development

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,790
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
Almost(if not just) all people have their own beliefs on our interested parts of the external world, so it's natural that we, as RMMV plugin developers, have our own beliefs in RMMV plugin development too. Those beliefs will normally be reflected on our plugins.

Being aware of those of our beliefs can help us reflect upon them and hence possibly making our plugins more desirable to ourselves(present and/or future) and/or their targeting audiences/addressed situations.

This post aims to incite you to share at least some of your beliefs in RMMV plugin development and freely discuss what are shared here while still keeping an open mind.

While I want the discussions to remain explorative and open ended, it's also completely ok that they end up being countless and endless fierce heated debates, as long as they all remain civil and we're all still respecting each other.

I also want you to state how firm you hold the beliefs you shared here. Such degrees can be approximately classified into these 3 levels in my opinion:

Guidelines - You generally feel/think they're right in most cases but you still doubt there can be some unlikely exceptions, so you'll usually analyze whether they'll probably work on the specific cases before actually applying them.

Standards - You're so rigidly confident on them that you deeply trust that they're always universal truths unless they're solidly proven otherwise(in these cases you'll likely rethink on those beliefs instead).

Dogmas - You simply treat them as axioms so you'll instantly conclude that any contrary evidence must be itself problematic and can thus be safely discarded.

You don't have to conform to this categorization. It just serves as some examples to indicate how firm you hold your beliefs. For instance, you can say what you believe in are indeed undeniable facts.

I'll try my best to be as objective and rational as I can. I'll first try to thoroughly comprehend the beliefs shared here, then I might challenge them regardless of whether I agree with them or not.

Although it's certainly healthy that we argue against beliefs that we disagree, I still want you to focus more on sharing your own. I think we can learn more from the others and perhaps ourselves as well this way.

P.S.: In the RMVXA version of this topic, I tried to throw some examples I've collected from the RM coding communities to hope that more will be shared. However, it turned out, as I had suspected, many participant there focused on those examples rather than sharing their own. So this time I won't throw any example here to see if it'll encourage more of you to share more of your own :)
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Interesting topic! 

For myself since I am a programmer from Ace  where we had to be clear in our coding due Plugin Manager don't existed.

I get used to not prime the performance but the readability of my coding.

so yeah I follow mostly the dogmas of the "human minded coder" Or programmer who make their coding the most clear possible for even a noob would be able to read it and understand somewhat.

So the coding is not the most optimal I admit, but permit to get easily edited.

I also documents a lot's my script with usefull comment and ALL my method have clear name of what are their purpose.

For myself I can't stand code who are compacted and unreadable EVEN if this help to the performance.

I also not follow the Whole JS conventions even if this got some of the js "elitist" cringe their teeths I often mixe up CamelCase and Snake space in my method and variable name such : 

methodNamethats_reallyLongMethodNamesimply because if I can't read the method name it's annoying me so I do separation.

and I am originally a Ruby user and don't really care of all those JS "standard".

After I also not code like the other people where they mostly all use modular coding or anonymous for the Parameter I use a function for store my parameters 

(I created a core for that too) I do though use anonymous for alias.

In simple a lots of people might think as me as a Violent Energy because I don't want to follow the standard of JS, but I don't really care I code in the way's I feel comfortable.

so in simple my meaning is being simple , yet still powerful and friendly for people.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
one thing that bug me...

some plugins that wrap in anonymous function

(function() { // …})();it's okay... but the problem lies when they alias something but using private variable inside that anonymous function. this mean the old method cannot be accessed by other plugins.

(function() { var estMyOldFunction = Game_Enemy.prototype.opponentUnits;})();we cannot access the estMyOldFunction thus the Game_Enemy.prototype.opponentUnits before modified is LOST...

at least store the old function inside a module / container wrapper !!!so other plugin maker can create compatibility patch.

ex:

var EST = EST || {};EST.myPluginName = EST.myPluginName || {};(function() { EST.myPluginName.oldGameEnemyOpponentUnits = Game_Enemy.prototype.opponentUnits;})();thus we can access it using:

EST.myPluginName.oldGameEnemyOpponentUnitsi personally didn't wrap my code in anonymous function. i also don't use "use_strict" but i debug my code carefully so i doesn't miss var or ;.

edit: i also ACE programmer... about snake case and camel case... i stand neutral... i slowly use camel case though... since it sometime shorten the variable name. (which because of my habit to also include class and function in alias could become long enough)

est_region_map_loader_game_interpreter_old_plugin_commands

estRegionMapLoaderGameInterpreterOldPluginCommands

:D

also... anoher thing...

instead of:

if (condition){onelinercode;}i prefer using:

if (condition) onelinercode;or if it's long oneliner code

Code:
if (longcondition)     onereallylonglinercode;
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
we cannot access the estMyOldFunction thus the Game_Enemy.prototype.opponentUnits before modified is LOST...
That's kinda the point. If i hook my plugin into this function, i want my version to be called, not the original one. The correct approach (imho) is to only have a single function call in your aliased method and make that function public, if needed.
i personally didn't wrap my code in anonymous function.
So this means that every variable you declare outside a function is leaked into the public scope. Please stop doing that.
if (condition) onelinercode;
Personally, i dislike this very much, as you can easily miss adding the brackets if you want to execute more than a single statement, which causes your code to break. Also, it makes the code harder to read for other scripters.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@Nio

yourWayIsOKButIPersonallyPreferItThisWayBecauseOtherwiseLooksABitWeirdComparedToOriginalMVCodeAndAnyOtherJSCode@Estriole

Why do you need to access the original method anyway?

And yeah, I also do

Code:
if(something)something;
and sometimes I even do
Code:
for(a;b;c) if(d) if(e) if(f) this.g();
and I also don't like when I see this :
Code:
if(something) {    this.a();} else {    this.b();}
and I turn that into :
Code:
something ? this.a() : this.b();
and sometimes I even change
Code:
function() {    oneline;}
to
Code:
function() { oneline; }
I know those are even more unreadable, but I prefer it this way...
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
That was just an example, I didn't really have 3 if-s, but I did have 2-3 consecutive for-s
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
@kockaadmiralac : 

lol yes but the problem are it's just me who can't stand to not have separation and this make the stuff unreadable for me. I generally do a separation when my variable or method name have more than 3 words like's :  

set_ImageHeaderForSomethingweird but I just prefer do a snake separation for the first word lol.

I also often reduce my if statement to one line's if it's short's

@Estriole : I understand your pain! I hate all those anonymous function who make stuffs complicate to access  material because in a way's all global variable get still in the global space just isolated to one file :/
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@Nio

That's somewhat normal.

You would easier read is some method 'set' or 'get' or 'create' or 'update' etc.
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
566
First Language
English
Primarily Uses
RMMV
I prefer Pascal Casing, as I come from languages that use that as a standard, and it looks much nicer to me personally.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Code:
ThisIsPascalCasingItHasTheFirstWordUppercase
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
566
First Language
English
Primarily Uses
RMMV
Pascal Casing is the opposite of camelCasing.

camelCasing:

function myFunction() {}
PascalCasing

function MyFunction() {}
Its used in C# and C++ (to some degree, in C++ its more of a preference, and depends on whom you talk to and what standards you follow).
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
I see I ignored this as this name. 

I honestly always thinked using a capital letter in begin was never good but I think this just because Ruby auto recognize Capital letter as a constant.
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
I just follow what ever the communities standards are (out side of RM community). The community states cameCasing and FirstLetterUpperCase for classes. So I follow that :)
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,790
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
I'll use an example(not shared by anyone here yet) to show how I'd challenge your(possibly any of you here) beliefs:

Belief - Making other plugin developers unable to access the originally aliased functions but only yours is the right way, as only 1 version of any function should ever be exposed to be public.

Challenge - In RMVXA, I've encountered a compatibility issue where the easiest solution I can find is to call the originally aliased method instead of the other scripter's version. If this move's forbidden, I'll either have to copy the contents of the originally aliased method which can lead to new compatibility issues if they're aliased by some more other scripts, or write specific snippets based on each project of each user. I won't be surprised if similar cases will(if not already) come into play in RMMV.
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
That's kinda the point. If i hook my plugin into this function, i want my version to be called, not the original one. The correct approach (imho) is to only have a single function call in your aliased method and make that function public, if needed.

So this means that every variable you declare outside a function is leaked into the public scope. Please stop doing that.

Personally, i dislike this very much, as you can easily miss adding the brackets if you want to execute more than a single statement, which causes your code to break. Also, it makes the code harder to read for other scripters.
but some case need us to access original function. it's mainly for compatibility patch between your plugin and other person plugin.

execute original method. add something. executed modified method. especially if the modified method cannot be executed many times... it happen with my auto color plugin. fortunately yanfly keep his alias accessed. my opinion... used or not... at least don't remove reference to old function.

for the variable i declare outside a function is leaked... i admit guilty :D . and it happen before because of i still newb at JS.

but don't worry... my old plugin alias name is unique and not gonna have conflict with other people plugin

unless they deliberately do so.

but i will also slowly change... NOT by using anonymous function. but wrap all my alias with module / container.

so i won't pollute things beside one module/container (EST)... i still think no need to use anonymous function. :D . but that's personal opinion. just like i didn't use "use_strict". i just manually check.

for the ifs... i never use that method if i use more than single liner.

i realize though that it might not easy to read for other people. but it feel so clean instead of many {}

just like in ruby return if (condition) :D .

but again... personal opinion :D .
 
Last edited by a moderator:

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
I also believe in 'use strict'; which enrfoces some more strict standards in the form of writing javascript. 
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
I personally prefer pascel casing as well, as I've programmed a lot more in c# and c++.

I really don't like the _name format at all.

I hate almost any time an if statement is 1 line, when it could be made easier to read by writing out the brackets (something I probably got from c# as well lol)
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
C sharp is a camel case language too though ... If I'm correct.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top