Computer Programming/Standards and Best Practices

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Standards and Best Practices

Standards in computer programming are methods of programming that have been declared acceptable and thereafter are recommended as the approach that should be used. Much like what GAAP is to Accounting, programming standards allow programmers to use a common ground when writing code. Closely tied with programming standards, best practices are simply recommended methods of writing code. A segment of code can be transformed visually to comply with a programming best practice, however, syntactically the segment of code will remain the same. Best practices may also involve addition of extra code segments or removal of redundant code segments. To sum it up, best practices are simply the most recommended way of writing a segment of code, whereas programming standards are a specific set of rules to apply to coding style and techniques.

Standards, Best Practices, and Templates

Here you will find some information on the standards and best practices of several different languages. Also you will find templates that will help you start off on the right foot with all the best practices and standards included. This way, you will be able to begin your coding process already loaded up with all the best practices and standards, allowing for a better segment of code to be produced.

Language-specific best practices

Wikicode Standards Best Practices Template
C Page Here No Page No Page
C++ Page Here Page Here No Page
C# No Page No Page No Page
Java No Page Page Here No Page
Perl No Page No Page No Page
Python No Page PEP 8 No Page
Makefile No Page No Page No Page
Apache Ant No Page Page Here No Page
JavaScript No Page Page Here No Page
Visual Basic Page Here No Page No Page

Language-independent best practices

  • using a version management tool (also called a source control tool)[1][2][3]
  • make a build in one step (Makefile, Apache Ant, Gradle, Buildr, or etc).
  • test suites to make sure what you are working on does what you think it should. (This applies to every language, and even non-programming activities such as experimental science).[4]
  • test-first programming—writing the test for a new line of code before writing that new line of code.

Further reading