Naming Main Class of Bukkit Plugins

Status
This thread has been locked.

Shortninja

♥ Java Enthusiast ♥
Supreme
Feedback score
2
Posts
1,143
Reactions
734
Resources
0
Ah, another argument with McFeedle, the name of your main class in a Bukkit/Spigot plugin.

I used to have my main class named after the project, so if my plugin was called "Staff+" then my main class would be "StaffPlus". However, I decided to switch to "Main" because I found it more preferable.

On the other hand, McFeedle, claims that the main class should NOT be named "Main" because of the fact that Bukkit is an API and, "it may or may not use the Main class already" (McFeedle, page 24). He also linked me a picture of the Bukkit docs that says that it is preferable to name your main class like the latter.

The conventions of a class name is to state its function, so saying "Main" makes sense to me because it will be the "Main" class. While naming your main class the way McFeedle likes it doesn't necessarily follow this rule, your class can't be "StaffPlus" class really.

I think it matters on personal preference in the end, but McFeedle claims that my way is wrong. Like usual, it's his way or NO way.

I'd like to see the input of a few knowledgeable developers around here and others. Is there any set rule that can be seen at all (McFeedle claims this) or is it personal preference (my claim)?

Skionz Badger ItsMonkey saint
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Shortninja

♥ Java Enthusiast ♥
Supreme
Feedback score
2
Posts
1,143
Reactions
734
Resources
0
ItsMonkey I agree with the collaboration thing, if you argue about your project manager's preferences you will probably be fired or just be ignored.
 

Shortninja

♥ Java Enthusiast ♥
Supreme
Feedback score
2
Posts
1,143
Reactions
734
Resources
0
Tres True, but the same can be said for Java conventions. If you do not follow the conventions of naming things, like variables and classes, it is considered very bad practice.

The conventions of naming classes are that it must be "UpperCamelCase" and that it must define the class's function in a concise manner from what I can remember.

Just like the color of clothes, some people dislike red shirts and others dislike blue shirts, but they both have the same purpose and work the same. Human psychology is interesting, but, in programming, rules must be set to ensure that things remain relatively neat and similar (think of the MLA style for documents).
 
Last edited:

Skionz

ogminecraft.com
Premium
Feedback score
1
Posts
1,544
Reactions
1,527
Resources
0
Ah, another argument with McFeedle, the name of your main class in a Bukkit/Spigot plugin.

I used to have my main class named after the project, so if my plugin was called "Staff+" then my main class would be "StaffPlus". However, I decided to switch to "Main" because I found it more preferable.

On the other hand, McFeedle, claims that the main class should NOT be named "Main" because of the fact that Bukkit is an API and, "it may or may not use the Main class already" (McFeedle, page 24). He also linked me a picture of the Bukkit docs that says that it is preferable to name your main class like the latter.

The conventions of a class name is to state its function, so saying "Main" makes sense to me because it will be the "Main" class. While naming your main class the way McFeedle likes it doesn't necessarily follow this rule, your class can't be "StaffPlus" class really.

I think it matters on personal preference in the end, but McFeedle claims that my way is wrong. Like usual, it's his way or NO way.

I'd like to see the input of a few knowledgeable developers around here and others. Is there any set rule that can be seen at all (McFeedle claims this) or is it personal preference (my claim)?

Skionz Badger ItsMonkey saint
Technically this isn't the main class since it does not contain the main method, but shit happens.
 

Shortninja

♥ Java Enthusiast ♥
Supreme
Feedback score
2
Posts
1,143
Reactions
734
Resources
0
Skionz Perfect point, never thought of that. However, each plugin has a "main" class that is defined within the "plugin.yml", so I guess you can say that they do have a main class in a way.

Six Yes I've seen somebody do that before. I believe that is fine as well, as long as it is clear what it's for.
 
Status
This thread has been locked.
Top