Home
Do you use Enums instead of hard coded strings?
  v1.0 Posted at 27/04/2018 1:54 AM by Tiago Araujo

Use Enums instead of hard-coded strings, it makes your code lot cleaner and is really easy to manage.

EnumBadExample.jpg
Figure: Bad example - "Hard- coded string" works, but is a bad idea
EnumGoodExample.jpg
Figure: Good example - Used Enums, looks good and is easy to manage

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.