Should a “static final Logger” be declared in UPPER-CASE?

In Java, static final variables are constants and the convention is that they should be in upper-case. However, I have seen that most people declare loggers in lower-case which comes up as a violation in PMD. e.g: private static final Logger logger = Logger.getLogger(MyClass.class); Just search googleor SO for “static final logger” and you will … Read more

Why do variable names often start with the letter ‘m’? [duplicate]

This question already has answers here: Why do most fields (class members) in Android tutorial start with `m`? (14 answers) Closed 6 years ago. Looking at the Android tutorials such as the Notepad tutorial, I noticed that almost all variables are named starting with the letter ‘m’. What convention is this, and where does it … Read more

Is the underscore prefix for property and method names merely a convention?

Is the underscore prefix in JavaScript only a convention, like for example in Python private class methods are? From the 2.7 Python documentation: “Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with … Read more

Anyone else find naming classes and methods one of the most difficult parts in programming? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

Coding Conventions – Naming Enums

Is there a convention for naming enumerations in Java? My preference is that an enum is a type. So, for instance, you have an enum Fruit{Apple,Orange,Banana,Pear, … } NetworkConnectionType{LAN,Data_3g,Data_4g, … } I am opposed to naming it: FruitEnum NetworkConnectionTypeEnum I understand it is easy to pick off which files are enums, but then you would … Read more