Best Coding Practices

Best Coding Practices

Best coding practices for software development can be broken into many levels based on the coding language, the platform, the target environment and so forth. Using best practices for a given situation greatly reduces the probability of introducing errors into your applications, regardless of which software development model is being used to create that application.

There are standards that originated from the intensive study of industry experts who analyzed how bugs were generated when code was written and correlated these bugs to specific coding practices. They took these correlations between bugs and coding practices and came up with a set of rules that when used prevented coding errors from occurring. These standard practices offer incredible value to software development organizations because they are pre-packaged automated error prevention practices; they close the feedback loop between a bug and what must be done to prevent that bug from recurring.

In a team environment or group collaboration, best coding practices ensure the use of standards and uniform coding, reducing oversight errors and the time spent in code review. When work is outsourced to a third-party contractor, having a set of these best practices in place gives you the knowledge that the code produced by the contractor meets all the guidelines mandated by the client company.

It should be understood that these practices are not just a way to enforce naming conventions in your code.

Best coding practices gives you a way to analyze your source code so that certain rules and patterns can be detected automatically and that the knowledge obtained through previous years of experience by industry experts is implemented in an appropriate way.

With the foregoing in mind, here is a base list of what is needed for a project that successfully utilizes 'Best Coding Practices':

Lifecycle

It is important to choose the appropriate development lifecycle for a given project because all other activities are derived from this process. A couple examples of this are the Rational Unified Process (RUP) and the eXtreme Programming (XP) methods. Having a well defined process is usually better than having none at all, and in many cases it is less important what process is used than how well it is executed. The methodologies above are very common and a quick Web search will turn up all kinds of information regarding how to implement them.

Requirements

Everyone needs to be on the same page before jumping into programming. This is a fundamental truth to almost any endeavor and even more so when accomplishing a group driven programming task. If you are programming alone, you may find yourself adding or tweaking your application. When you are looking at an enterprise piece of software, everyone involved in the project needs to understand clearly the requirements and goals of the project before moving forward. This is often referred to as Functional and Detailed Specifications.

Architecture

Choosing the appropriate architecture for your application is key. You have to know what you are building on before you can start a project. Check the architecture of the target. Read as much as you can about the ins and outs of the platform and note any pitfalls before you start your code. It will go a long way to heading off any bugs that might be 'show stoppers' later on.

Design

Even if you feel great about knowing the architecture of your target platform without a good design you are going to be sunk. Try not to fall into the trap though of over-designing the application. The two basic principles are to "Keep it Simple" and to utilize information hiding (Don't show the user more than they need to see). Often this is where object-oriented analysis and UML come in. Do an internet search on UML and you'll find dozens of articles on using it.

Code Building

Building the code is really just a small part of the total project effort even though it's what most people equate with the whole process since it's the most visible. Other pieces equally or even more important include what we have already gone over above namely requirements, architecture, analysis, design, and testing. A best practice for building code involves daily builds and testing.

Peer review

It's OK, really! Look at other people's work. Learn from it. If you have a problem, chances are someone else has already had and resolved the same problem. Don't be afraid to ask questions. You can return the favor by letting others see your code and learn from it.

Testing

Testing is an integral part of software development that needs to be planned. It is also important that testing is done proactively; meaning that test cases are planned before coding starts, and test cases are developed while the application is being designed and coded.

Deployment

Deployment is the final stage of releasing an application for users.

References

See also

*Automated code review
*Best practice exchange
*Software Assurance

External links

* http://www.ibm.com/developerworks/aix/library/au-hook_duttaC.html By R.K.Paikaray(Gsec1 Ltd)


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Best practice — is an idea that asserts that there is a , method, process, activity, incentive or reward that is more effective at delivering a particular outcome than any other technique, method, process, etc. The idea is that with proper processes, checks, and …   Wikipedia

  • Coding conventions — are a set of guidelines for a specific programming language that recommend programming style, practices and methods for each aspect of a piece program written in this language. These conventions usually cover file organization, indentation,… …   Wikipedia

  • Six Best Practices — is a paradigm in software engineering that lists six ideas to follow when designing any software project to minimize faults and increase productivity as described in Rational Unified Process. These practices are: *Develop Iteratively – it is best …   Wikipedia

  • Extreme Programming Practices — Extreme Programming (XP) is a popular agile software development methodology used to implement software projects. This article details the practices used in this methodology. Extreme Programming has 12 practices, grouped into four areas, derived… …   Wikipedia

  • Visual Basic for Applications — (VBA) Paradigm(s) Multi paradigm Appeared in 1993 Developer Microsoft …   Wikipedia

  • Software development process — Activities and steps Requirements Specification …   Wikipedia

  • List of code quality management dashboards — This is a list of significant tools for helping managers and developers to measure, control and improve applications health. As a rule, those tools are composed of four layers : * Static or dynamic code analysis engines to provide metrics such as …   Wikipedia

  • Цикл разработки программного обеспечения — Эта статья предлагается к удалению. Пояснение причин и соответствующее обсуждение вы можете найти на странице Википедия:К удалению/30 июля 2012. Пока процесс обсуждения …   Википедия

  • Software quality — Contents 1 Motivation for Defining Software Quality 2 Definition 3 Alternative Approaches to Software Quality Defin …   Wikipedia

  • Computer security — This article is about computer security through design and engineering. For computer security exploits and defenses, see computer insecurity. Computer security Secure operating systems Security architecture Security by design Secure coding …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”