Sobes.tech
Junior

What signs indicate the presence of hardcoding in application code?

sobes.tech AI

Answer from AI

  • Direct use of string literals in code, instead of resource references (R.string.*).
  • Direct use of numeric values for sizes (dp), colors (#RRGGBB), styles, and other UI attributes, instead of resource references (R.dimen.*, R.color.*, R.style.*).
  • File paths or URLs explicitly written in the code.
  • Logic tied to specific fixed values that may change in the future (e.g., list indices or magic numbers).
  • Absence of constants or enums for values used repeatedly.
  • Lack of localization: messages are always displayed in one language, although the app may be used in different regions.