iSnare.com - Free Content Articles Directory
Authors Contents [Advanced Search][Add OpenSearch][Job Search]
Distribute your articles to thousands of article sites for only $2 and below! Read more...

Index  Computers and Technology
 

Importance Of Coding Standards

 
[ Contact the Author] [ Send to a Friend] [ Article Publisher] [Make PDF] [ Print] [ Bookmark & Share]
 
Read our Terms of Service before reprinting this article. The submitter specified above has claimed the rights to this article.
John Dirk

Programming Help for Beginners - Importance of Coding Standards

Programming Help for Beginners
Importance of Coding Standards

We write programs to instruct computers. When programming using a high level programming language like C++ or Java, we are using a syntax that is somewhat closer to human languages. However, we use these programs as inputs to either compilers or interpreters to be converted to computer understandable binary format. For this reason, as far as the program code adheres to the syntax of the used programming languages, the compilers and interpreters never bother about the layout or visual formatting of the program code. However, as human programmers, we ourselves need to bother about the aesthetics of the program code.

What is a Coding Standard?
A coding standard is a set of guidelines, rules and regulations on how to write code. Usually a coding standard includes guide lines on how to name variables, how to indent the code, how to place parenthesis and keywords etc. The idea is to be consistent in programming so that, in case of multiple people working on the same code, it becomes easier for one to understand what others have done. Even for individual programmers, and especially for beginners, it becomes very important to adhere to a standard when writing the code. The idea is, when we look at our own code after some time, if we have followed a coding standard, it takes less time to understand or remember what we meant when we wrote some piece of code.

Coding Standards Make a Difference
Look at the following example:

int volume(int i, int j, int k) {
int vol;
vol = i * j * k;
return vol;
}

Looking at this code at a glance, it takes some time for one to understand that this function calculates the volume. However if we adhere to a naming convention for variables and method names, we could make the code more readable.

Here are few sample conventions:

use meaningful variable names
use verbs in method names
use nouns for variables
use 4 spaces to indent

int calculateVolume(int height, int width, int length) {
int volume = 0;
volume = height * width * length;
return volume;
}

It takes more time to type this code, however this saves far more time. This code is far more readable than its original version. With a little bit of effort, we could make the code much more understandable.

The Benefits
It is not only the readability that we get through a coding standard in programming. Writing more secure code could also be encouraged through a coding convention. As an example, in C++ we could say that each pointer variable must be initialized to NULL.

char* myName = NULL;

This ensures that we would not corrupt memory while using this pointer variable.

Code readability is just one of the aspects of maintainability. Coding standards help a great deal with program maintainability, our ability to change programs with ease. Consistency imposed through a coding standard is a key factor to achieve success in maintaining prorams.

Defining Your Own Coding Standard
A programmer can define his or her own coding convention and adhere to that in writing programms. However there are many coding conventions available on the Internet. Those who program in Java should have a look into Code Conventions for the Java Programming Language by Sun(http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html).

For C++ coding standards, I would recommend that you have a look into C++ Coding Standards from BBC(http://www.bbc.co.uk/guidelines/webdev/AppB.Cpp_Coding_Standards.htm). C++ Programming HOWTO has some C++ Coding Conventions and also a bunch of links that lead to several coding standards that you can pick from(http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-14.html).

John Dirk

Programming Consulant
http://www.programminghelp4u.com - Programming ( Assignment / Project) Help

Important NoticeDISCLAIMER: All information, content, and data in this article are sole opinions and/or findings of the individual user or organization that registered and submitted this article at Isnare.com without any fee. The article is strictly for educational or entertainment purposes only and should not be used in any way, implemented or applied without consultation from a professional. We at Isnare.com do not, in anyway, contribute or include our own findings, facts and opinions in any articles presented in this site. Publishing this article does not constitute Isnare.com's support or sponsorship for this article. Isnare.com is an article publishing service. Please read our Terms of Service for more information.

John has years of experience on systems analysis, software design and implementation. He is an expert programmer in C/C++ and Java. Additionally he also has several years of experience as a lecturer and tutor on programming and related subjects.
Article Tags: code [See Dictionary], coding [See Dictionary], programming [See Dictionary]
Got a question about this article? Ask the community!
Article published on July 29, 2005 at Isnare.com
 
Rate [Ratings: 5 / 5] [Votes: 1]

Incremental Programming
Submitted by: John Dirk

Programming Help for Beginners Many novice programmers start a program with a “big bang” approach, meaning they want to write the whole program in one step and then only they would try to compile and run...

Smartphone Vs Iphone - Pros And Cons
Submitted by: Roberto Sedycias

Smartphones and iPhone both are the novel introduction for communication, besides having a galore of features...

How to Prevent the Noise on Your Car Stereo
Submitted by: Jack Wylde

If you do not know or cannot comprehend what that term means “noise” from your car audio system then you perhaps don’t own a car audio system yet...

Dahle 30114 Personal Shredder Review
Submitted by: Jeff McRitchie

The Dahle 30114 is a personal-use shredder designed to be placed beside your desk and used occasionally throughout the day...

Comparing the Three Dahle Craft Trimmers
Submitted by: Jeff McRitchie

If you are in need of a new rotary trimmer for personal use, you might want to take a look at Dahle craft trimmers...

Dahle 30414 Shredder Review
Submitted by: Jeff McRitchie

Shredders are no longer a luxury in today's world With the onset of identity theft and increasing incidences of corporate espionage (not to mention federal regulations mandating the destruction of personal information) it is absolutely necessary for your office to have a shredder on site, and ready to use at all times...

Dahle 30430 Department Shredder Review
Submitted by: Jeff McRitchie

The Dahle 30430 is a high security shredder that is meant to be placed in a common area and used by multiple people during the course of the day...

Dahle 30114 Personal Cross-Cut Paper Shredder Review
Submitted by: Jeff McRitchie

Dahle is a premier name when it comes to paper shredders Based in Germany, the company has been in the paper shredding business for more than 20 years and they bring their experience and expertise to every shredder they manufacture, from small units to big ones...

MBM Destroyit 2404 Shredder Review
Submitted by: Jeff McRitchie

There is no better way to ensure the security of your confidential information than doing your own document shredding, on site and by hand...

MBM Destroyit 2501 Shredder Review
Submitted by: Jeff McRitchie

The Destroyit 2501 is MBM Corporation's smallest shredder that is designed for centralized, heavy-duty office use...

MBM Destroyit 2503 Shredder Review
Submitted by: Jeff McRitchie

Choosing a shredder for centralized office use is no easy task There are several models and manufacturers out there to choose from, all with similar but different capacities...

MBM Destroyit 3103 Shredder Review
Submitted by: Jeff McRitchie

With all the brands and models out there to choose from, finding the right shredder for centralized office use is no easy task...

Scrapbooking Requires Photo Matching Software
Submitted by: Maxim Smirnov

There was once a time when people used to get pictures developed and then cut them up to turn them into scrapbooks...

Find Duplicate Mp3 Files For Mixes
Submitted by: Maxim Smirnov

One of the easiest and cheapest ways to get a present for someone else is to make them a mix of some favorite songs...

How Do You Find Duplicate Photos Quickly?
Submitted by: Maxim Smirnov

You’re trying to create a fun project or a poster for a friend, but you need to find duplicate photos...

Teaching Students to Delete ITunes Duplicates
Submitted by: Maxim Smirnov

When you’re teaching a class, you might not realize that all of your music instruction is adding up to problems for your students...

Isnare.com Footer Divider

© 2004-2009. Isnare Free Articles - An Isnare Online Technologies Free Articles Project. All Rights Reserved.   Privacy Policy