For example, suppose I have a string constant like this:
const TITLEBAR_MESSAGE="Welcome back, %USERNAME%!";
I think it is more readable when it is named as
const WELCOME_BACK_USERNAME="Welcome back, %USERNAME%!";
because I don't need to move to the definition of TITLEBAR_MESSAGE to see what is the string context, also I don't need to remember that "TITLEBAR_MESSAGE" is mapped to "Welcome back,xxx" currently.
I know it would less maintainable when the string is changed because I also need to change its name. But code is read more than write, right? I think the latter naming is more straightforward so that other team members don't need to know what "TITLEBAR" is.
Similar cases also appears for colour constants:
Which I think:
is more straightforward (when there is just a few color only) as other team member doesn't need to know what "SOME_UI" is. So my question is, is a constant name related to its current value an anti-pattern?