Common Mistakes That Java Developers Make

 In my 13 years experience in the software industry, I've seen this mistakes done by other programmers:

  1. Long methods - A method that does a lot.
  2. Long switch and if statements.
  3. Long method names, variable names, class names, interface names.
  4. A method that has too many parameters.
  5. Not checking null variables.
  6. A class that contains public modifiable variables.
  7. Ignoring exceptions.
  8. Logs in release versions.
  9. Not using generic types when using collections.
  10. Not closing IO
  11. Lots of singleton classes.
  12. Lots of static public methods.
Are you making those mistakes too? Learn code refactoring then and check if the builds are release or debug versions when making logs. Client should not see any debugging or error logs from your app.

Things you should learn:
  • How to extract statements.
  • How to extract methods.
  • How to give variables, functions and classes a meaningful names.
  • Design patterns.
  • Basic OOP concepts such as: Encapsulation, Polymorphism, Composition and Inheritance.
  • Handling exceptions properly.
  • Generic types in collections.
  • Closing streams to free resources.

Comments

Popular posts from this blog

How To Check If Your Android Phone Is Official Or Rooted

Android Reverse Engineering - Beginners Guide To Smali Coding

Conquering macOS Upgrades: A Guide for iOS App Developers