1
I didn’t quite understand the concept of naming with uppercase and minuscule letters.
I know which classes should be named with the first capital letters (Camelcase), but and objects, variables, and other identifiers?
1
I didn’t quite understand the concept of naming with uppercase and minuscule letters.
I know which classes should be named with the first capital letters (Camelcase), but and objects, variables, and other identifiers?
1
This is just a naming convention, not necessarily followed, at least in Java and most languages. Some take it so seriously that they don’t have to, that they themselves don’t maintain a pattern. Java even misses a few things, although more rare.
This is important for the person not having to think too much when writing code and always keep it that way, while helping the reading since the written form already gives a better visual indication of what it is.
Class, instance or local methods and variables must be pascalCase
. It is recommended not to use _
even if you can.
Has a guide I responded well complete to C#, which helps to think about a lot of things. Of course Java follows slightly different patterns. You have to like one or the other. There are those who curse the fact that constants and enumerations in Java are ALL_CAPS
or methods are pascalCase
, there are those who think that only this way is good.
The important thing is to adopt and follow a standard and follow. Ugly, inconsistent code is hard to read. If adopting the standard language helps also who is not used to your code read.
Browser other questions tagged java encoding-style
You are not signed in. Login or sign up in order to post.
Related: Best practices for naming functions
– user28595
Related (perhaps duplicate): What is the convention for using upper and lower case names in Java?
– user28595
Related: How far should I follow the conventions, where I can apply specific style patterns?
– user28595
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero