1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

What difference does making various files for the plugin make instead of having one big Main.php?

Discussion in 'Development' started by HerO_0110, Jan 22, 2019.

  1. HerO_0110

    HerO_0110 Creeper

    Messages:
    4
    Title, and performance-wise only. Does it make any difference in speed?
     
  2. SavionLegendZzz

    SavionLegendZzz Slime

    Messages:
    75
    GitHub:
    savionlegends
    Organization is key, trust me I learned the hard way.
     
  3. ZackyVN

    ZackyVN Baby Zombie

    Messages:
    150
    yes making various kind of file help you more organization.
     
    xXNiceAssassinlo YT likes this.
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    There is no such thing as "multiple files" with PSR-0. Don't create multiple classes unless you actually need multiple objects.
    If you really want to organize your code in multiple files, create utility classes (final class, static methods) that handle values based on given parameters. Unless you are very proficient with the principles (not just the syntax) of object-oriented programming, there is no reason that you want to create other classes other than utility classes.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.