Questions about "Bad practice"

Discussion in 'Spigot Plugin Development' started by Jake1996, Jun 24, 2016.

  1. Hi, im just wondering what you guys would consider bad practice?

    For example: Ive seen people use static as a lazy way to access other classes, etc.

    Im quite new to this, however while im learning i'd like to be sure im heading in the right direction, and not turning into thebcbroz.

    Perhaps share the worst mistakes or common you've seen or done when you first started, i think it'd be beneficial for all new developers to read as they can see if any of those stories match their current situation, theres a chance for correction.

    Heres an example:
    Before i learnt java i made the mistake to jump into the Bukkit API, and it was a nightmare, i ended up abusing static because i had no idea about getters, setters, constructors or anything other than "Eventhandler", I think my funniest mistake was checking config booleans as Strings, and the way i sorted this out was alot of java tutorials and buying Java books.

    Thanks!
     
  2. I think it is just bad habits, people always have to grow up, always have to follow the Industry Standards
     
  3. Define your own standards and respect them, that's extremely important. Consistency of code is as important (if not more) than following global standards. You should always comment your code (even though very little of us do it).
    Overall, don't be lazy. In most cases, a shortcut is considered bad practice (static to access instances, public variables instead of getters/setters, etc.)
    Be aware of basic object-oriented programming principles such as separation of concerns, that's also very important. For example, an object should not handle the list in which it is stored.
     
    • Agree Agree x 2
  4. MiniDigger

    Supporter