Programming Practices – Is Hardcoding Values in Applications Ever a Good Idea?

programming practices

Is it ever a good idea to hardcode values into our applications? Or is it always the right thing to call these types of values dynamically in case they need to change?

Best Answer

Yes, but do make it obvious.

Do:

  • use constants
  • use a descriptive variable name

Don't:

Related Topic