Jump to content

Talk:Coding conventions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ptrb (talk | contribs) at 21:15, 17 November 2010 (Proposal 2). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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)[reply]

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)[reply]

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).[reply]

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.

  1. Coding conventions — Have this as the leading article on this topic
  2. Programming style — Limit this to style (read: layout, formatting) only, move other content to respective articles
    1. Need to double check, if there are other articles on layout, formatting, that would need to be involved in these considerations
  3. 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)[reply]

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

  1. 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
  2. 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)[reply]

DONE , Ptrb (talk) 07:55, 17 November 2010 (UTC)[reply]

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:

  1. No more than 80 characters, including white space, should be in one line.
  2. Only one statement should be on each line.
  3. 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)[reply]

DONE , Ptrb (talk) 21:15, 17 November 2010 (UTC)[reply]

Proposal 3


Move complete following sections from Programming style to Coding conventions

  1. Programming_style#External_links
  2. Programming_style#Coding_conventions_for_languages
  3. Programming_style#Coding_conventions_for_projects

Ptrb (talk) 16:53, 3 November 2010 (UTC)[reply]

Proposal 4


Next to the general article on Naming convention (programming),

Currently (Nov-5-2010) located articles are:

Ptrb (talk) 14:08, 5 November 2010 (UTC)[reply]

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.

  1. Changed redirect on Coding standard to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  2. Changed redirect on Coding standards to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  3. Changed redirect on Code convention to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  4. Changed redirect on Code conventions to point to Coding conventions — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  5. On Programming style Added merge-to codes for Coding conventions and Naming convention (programming) — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  6. On Coding conventions Added merge-to code Naming convention (programming) — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  7. On Coding conventions Added merge-from code Programming style — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  8. On Naming convention (programming) Added merge-from codes for Coding conventions and Programming style — Ptrb (talk) 16:15, 3 November 2010 (UTC)
  9. Added proposal section Talk:Coding_conventions#Proposal_0Ptrb (talk) 22:18, 3 November 2010 (UTC)[reply]
  10. Added proposal section Talk:Coding_conventions#Proposal_1Ptrb (talk) 22:18, 3 November 2010 (UTC)[reply]
  11. Added proposal section Talk:Coding_conventions#Proposal_2Ptrb (talk) 22:18, 3 November 2010 (UTC)[reply]
  12. Added proposal section Talk:Coding_conventions#Proposal_3Ptrb (talk) 22:19, 3 November 2010 (UTC)[reply]
  13. At Naming convention (programming), in "See also" section, add explicit pointer to Category:Naming conventionsPtrb (talk) 14:19, 5 November 2010 (UTC)[reply]