Code development suggestions

Things to remember while coding and best development approach thoughts:

  • Focus on work, never compromise on Quality
  • Never start with code, but start with Test
  • Never ever forget to ask 5 times 'WHY'
  • Spending a time on naming is worth
  • Consider Static factory methods
  • Utility classes should be Noninstantiability
  • Use Singleton properly, consider enum
  • Don’t create unnecessary objects
  • Be careful with Auto-boxing expressions
  • Always write Javadoc for public classes and methods
  • Avoid using finalize method
  • Identify and remove obsolute objects
  • Always revoke hashCode when overriding equals
  • Minimize accessibility and mutability
  • Favour composition over inheritance
  • Program to interfaces, not to classes
  • Never use interfaces for defining Constants, use Utility class
  • upgrade static member classes over nonstatic
  • Prefer generic type classes and methods
  • Never use raw types in new code
  • Never ignore unchecked warnings
  • Narrow scope of warnings
  • Prefer enums instead of int or String constants
  • Validate method arguments in public classes
  • Use assertions to validate private method arguments
  • Return a copy of object instead reference
  • Don't eat exceptions
  • Methods and classes should have single responsibility
  • Minimize scope of local of variables
  • Prefer for loop over while, opportunity for reducing scope
  • Prefer for-each loop instead traditional for loop
  • Prefer primitive types over wrapper types
  • Consider Builder pattern
  • Always return empty collections or array, but not null
  • Never forget to put @override while overriding a method
  • Perform concatenation using StringBuilder orStringBuffer
  • Use serialization properly
  • Consider performance
  • Consult API - don’t reinvent the wheel
HTML Comment Box is loading comments...