Skip to content

Instantly share code, notes, and snippets.

View safwan-moha's full-sized avatar
🎯
Focusing

Safwan Mohammed safwan-moha

🎯
Focusing
View GitHub Profile
  1. Emphasis on Code Reuse

    if(number > maxValue) ... is used in multiple places. Can be taken to one place

  2. Exception is generic. Instead we can throw IllegalArguemntException

  3. Being consistant. All the places Exceptions are thrown. Only in one place System.err.print is used. Better to throw exception there too