Answer the question
In order to leave comments, you need to log in
What are the notations (naming rules) in programming?
I met two types of notation:
- camelCase;
- under_score.
Based on the above I saw combinations of styles .
Pros and cons , as I understand it - this is a purely personal matter (individual, company). What are you using? I will use the corrected style tomorrow, based on the source .
I've been learning programming for a couple of months. Now in Java I use the following conventions:
1. variable int iValue = 0;
(I put the first symbol of the type in the prefix);
2. instance variable int m_iValue = 0;
(met in S.Prata 's book )
3. function/method: camelCase;
4. Grades: CamelCase;
5. objects: obj_jlabName = new JLabel();
(something similar in the book atG. Schildt about Swing ).
Conclusion #1: Self-documenting code. Source - post and comments on this question.
Conclusion #2: Reading books like Perfect Code , Clean Code .
Answer the question
In order to leave comments, you need to log in
I don't see the point in modern IDEs with syntax highlighting, putting information about the type and class membership in the variable name.
-less gibberish
-more readability and self-commenting code
Briefly: Name so that the meaning of the variables (code) is clear not only to you.
I've been learning programming for a couple of months.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question