So I was given a plugin to fix/add stuff

Discussion in 'Plugin Development' started by Zarkopafilis, Jun 23, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Zarkopafilis

    I saw a public static void main method inside - the dev said it would run 'faster' with this. Is there a point on doing that?
     
  2. Offline

    Zupsub

    You can start the specific class as an normal java application. (if it has String[] as argument)
     
  3. Offline

    Rocoty

    Zarkopafilis it won't run faster, no... I don't see a point in this.
     
  4. Offline

    ZeusAllMighty11

    wat
     
    Gater12 likes this.
  5. Offline

    Rocoty

  6. Offline

    ZeusAllMighty11

    Why would you do that?
     
    AoH_Ruthless likes this.
  7. Offline

    Rocoty

  8. Offline

    Konkz

    As said above it won't run faster but the original developer may of used 'static' so he can access it without making the instance of class. So he can do Utils.doMyMethod(); instead of Utils.getInstance().doMyMethod();
     
  9. Offline

    Zupsub

    The method is named 'main'. So in 99,99% (or even 100%) it's for starting that class as a normal Java program.

    Maybe the developer did this for testing the class (bad practice btw. (this main method for testing, not testing itself)), or he need it for debuggen or ... Of course the content of this method might be solve the question, or just asking the former dev.
    But, no, it's not quicker in any way.
     
  10. Offline

    Konkz

    Oh, I misunderstood what he wrote. I though something else.

    And perhaps the developers knowledge just did not expand far enough that he went with what worked and not what was efficient.
     
  11. Offline

    Zarkopafilis

    Okay but I see no point in all this
     
  12. Offline

    1Rogue


    Test cases for testing different aspects of the plugin without loading into a server
     
  13. Offline

    Zarkopafilis

    Aw thats it xD
     
Thread Status:
Not open for further replies.

Share This Page