Good coding practices

Good coding practices


Use good names

Do you have children.


Two boys and one girl. You do not call them b1, b2 ang g1, are you not ?

So why do you call your variables like that?

Bad examples:

  • x1
  • y2
  • d3


Good:

  • currentLimit
  • maxCount
  • userName




Use simular names!



Use JSON property

Bad code:

Good code:



Use functions!

Do not repeat youself!

Bad code:


Good code:




Report Page