Talk:Coding conventions
This Code Conventions for the Java Programming Language document contains the standard conventions that we at Sun follow and recommend that others follow. It covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices and includes a code example. Why have code conventions? Code conventions are important to programmers for a number of reasons:
* 80% of the lifetime cost of a piece of software goes to maintenance. * Hardly any software is maintained for its whole life by the original author. * Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
The Code Conventions for the Java Programming Language document was revised and updated on April 20, 1999. [1]
One class per file is not necessary true. In Jave or C#, sometimes there is a need to declare private classes which have to share source files with some other public classes.G7shihao (talk) 02:52, 20 February 2009 (UTC)
Programming style
This article overlaps with Programming style and Coding standards and has no proper link to de:Programmierstil. I dare not change it, because I cannot decide which of the two articles could go to orcus or if both could get a clear different lemma.--Brf (talk) 15:46, 11 December 2009 (UTC)
Refactoring coding conventions and programming style articles
Below are my proposals for some bigger (but straight-forward) changes to the below indicated 3 articles. Feel free to comment them. It is Nov-5-2010 now, I will not start execution before some week(s) have passed by. Proposals for smaller changes/merges to the (currently) 3 involved articles, I have not looked into yet. Also here, any proposals/comments are welcome. Thanks, Ptrb (talk) 07:09, 5 November 2010 (UTC).
Proposal 0
As a general direction for the refactoring of the following arcicles. I suggest to work towards the given focus for each of them.
- Coding conventions — Have this as the leading article on this topic
- Programming style — Limit this to style (read: layout, formatting) only, move other content to respective articles
- Need to double check, if there are other articles on layout, formatting, that would need to be involved in these considerations
- Naming convention (programming) — Limit to naming conventions, move all naming convention specific to here, and point to this article from the other articles
Ptrb (talk) 16:50, 3 November 2010 (UTC)
Proposal 1
The content provided here Programming_style#Appropriate_variable_names is more or less equivalent to the content provided here Naming_convention_(programming)#Business_value and here Naming_convention_(programming)#Length_of_identifiers. I suggest to
- delete the "get a b c" vs. "get hours minutes seconds" example here Programming_style#Appropriate_variable_names , and to stick to Naming_convention_(programming)#Business_value
- consider to migrate the statement on "In early programming languages" from Programming_style#Appropriate_variable_names to here Naming_convention_(programming)#Length_of_identifiers
Ptrb (talk) 14:52, 3 November 2010 (UTC)
Proposal 2
Move this section Coding_conventions#Common_conventions (which is only dealing with naming issues) to this article Naming convention (programming), and to turn it into a level 1 section called "Examples" (or so). The following leftovers would stay in Coding_conventions#Common_conventions for now:
- No more than 80 characters, including white space, should be in one line.
- Only one statement should be on each line.
- An extra character should go early in a comment block to delimit the beginning of externally published or processed documentation.
Ptrb (talk) 16:36, 3 November 2010 (UTC)
Proposal 3
Move complete following sections from Programming style to Coding conventions
- Programming_style#External_links
- Programming_style#Coding_conventions_for_languages
- Programming_style#Coding_conventions_for_projects
Ptrb (talk) 16:53, 3 November 2010 (UTC)
Proposal 4
Next to the general article on Naming convention (programming),
- There is a category Category:Naming conventions, to which relevant articles may (and should?) be assigned.
- (Just added this to the SeeAlso section here Naming convention (programming))
- There are several articles that deal with specific naming conventions, here it should be ensured that the Naming convention (programming) does not hold (too much) redundancy and rather refers to these articles.
Currently (Nov-5-2010) located articles are:
- CamelCase ( and is mentioned somewhere in Naming convention (programming) )
- Hungarian notation ( and is mentioned somewhere in Naming convention (programming) )
- Leszynski naming convention (The Leszynski naming convention (or LNC) is a variant of Hungarian notation)
- Also check if LNC is listed at the respective ambiguation page ( DONE, is listed there )
- Leszynski naming convention (The Leszynski naming convention (or LNC) is a variant of Hungarian notation)
- Sigil (computer programming)
Ptrb (talk) 14:08, 5 November 2010 (UTC)
Refactoring coding conventions and programming style articles - Summary of preparations and changes made
In case you should be watching this, please just give me some time to write down my concerns and suggestions.
- Changed redirect on Coding standard to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- Changed redirect on Coding standards to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- Changed redirect on Code convention to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- Changed redirect on Code conventions to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- On Programming style Added merge-to codes for Coding conventions and Naming convention (programming) — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- On Coding conventions Added merge-to code Naming convention (programming) — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- On Coding conventions Added merge-from code Programming style — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- On Naming convention (programming) Added merge-from codes for Coding conventions and Programming style — Ptrb (talk) 16:15, 3 November 2010 (UTC)
- Added proposal section Talk:Coding_conventions#Proposal_0 — Ptrb (talk) 22:18, 3 November 2010 (UTC)
- Added proposal section Talk:Coding_conventions#Proposal_1 — Ptrb (talk) 22:18, 3 November 2010 (UTC)
- Added proposal section Talk:Coding_conventions#Proposal_2 — Ptrb (talk) 22:18, 3 November 2010 (UTC)
- Added proposal section Talk:Coding_conventions#Proposal_3 — Ptrb (talk) 22:19, 3 November 2010 (UTC)
- At Naming convention (programming), in "See also" section, add explicit pointer to Category:Naming conventions — Ptrb (talk) 14:19, 5 November 2010 (UTC)