Should the names of my constants incorporate the units that it represents, or is this better handled by a short comment? Sometimes the constant names can become lengthy. For example, I can choose between:
// Seconds spent displaying logo
public static final float LOGO_DISPLAY_TIMER = 1.5f;
and
public static final float LOGO_DISPLAY_TIMER_IN_SECONDS = 1.5f;
I've been reading Clean code, which places great emphasis on accurate naming conventions, but I wasn't sure about this specific case.
In my opinion - If there are no code conventions from your company or sth. like that, take what you like and feel comfortable. The main point is that you are consistent and use every time the same style.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With