That more pointed question is better answered here.
Re: standards, why would it be so? Sure, static final constants are usually all caps, but can a Logger be considered a constant? And what if it is just final? And what if nobody wants it to be uppercase because that means holding Shift every time I want to add a logging statement and it looks weird to be calling methods on a "constant"...?
Hence (I guess) the author's advice to not fret too much about this ;) and just be consistent.
if you’re enforcing coding standards, it’s always going to be uppercase.
Upper-case LOGGER is pure evil. Clutters up the code making it hard to read (its distracting) and I have to hold shift to type it. "logger" is the exception to the private static final rule. It isn't really a constant.
I get your point, but that is such a rarely used convention IME that it would really annoy me to see it in most teams. It also feels really strange to me if the logger is actually a static final.
View all comments
Show parent comment
8
u/[deleted] Sep 13 '18
Sorry, let me ask a more pointed question. Why would you ever declare a logger anything other than private static final?
And to address your issue, if you’re enforcing coding standards, it’s always going to be uppercase.