Why are all Bukkit plugins so "complicated"?

Discussion in 'Bukkit Discussion' started by Lupus_Z, Jan 29, 2017.

Thread Status:
Not open for further replies.
  1. Every code of random plugins I look at (with java decompiler) is with 19 different classes + 189 methods and otherthings, like a method that does nothing: it just returns true. For example SilkSpawners, it has 1905 lines of codes, when you can simply do it with events like onBlockPlace and onBlockBreak in 50-60 lines of code. Why?
     
    AsapRocky likes this.
  2. @Lupus_Z
    Well, larger plugins often tend to use some sort of infrastructure to keep track of commands or events, as it becomes quite messy if you don't. Sure, these plugins could cram everything into the main class, but it'd be practically impossible to figure out what the code does if it's all in a big mess.

    Another reason you might see some pretty stupid code when decompiling is that the java decompiler (especially if you're using a lesser known one) often reconstructs source code pretty badly. You'll notice a crap tonne of iterators in decompiled code, which look really stupid, but they were originally just enhanced forloops.
     
  3. Offline

    Tecno_Wizard

    Can confirm. Working on something you'd expect to only be 2-3k lines, but because of all of the organizing structure it needs to make things easy to upgrade and manage, it turns out to be more like 7k. The higher the line count gets, the exponentially higher the amount of code is needed for organizing.
     
Thread Status:
Not open for further replies.

Share This Page