• Resolved Fact Maven

    (@factmaven)


    I wanted to know what’s the advantage of adding a class structure to your plugin rather than just calling the functions and when it’s appropriate to use them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Classes and OO programming tend to keep your codebase “cleaner” and more defined. As an example, using a ‘Cart’ class with 15 internal methods for an ecommerce site rather then having 15 individual functions spread out in pretty much any file you decide to keep them in. There’s also advantages in using inheritance, namespacing, etc. Most of the advantages are more to do with ease of programming, ease of debugging and ease of upgrades and changes – and almost all of that’s for the programmer, not the end-user.

    Thread Starter Fact Maven

    (@factmaven)

    Makes sense, thanks for the clarification.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a class to your plugin?’ is closed to new replies.