Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/a26f9f83/public_html/articles/includes/config.php on line 159
Importance of Coding Standards > NetSparsh - Viral Content you Love & Share

Importance of Coding Standards

Programming Help for Beginners

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 http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html - Code Conventions for the Java Programming Language by Sun.

    For C++ coding standards, I would recommend that you have a look into http://www.bbc.co.uk/guidelines/webdev/AppB.Cpp_Coding_Standards.htm - C++ Coding Standards from BBC.

    http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-14.html - 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.

    John Dirk
    Programming Consultant
    http://www.programminghelp4u.com/
    Programming ( Assignment / Project ) Help

    In The News:

    This RSS feed URL is deprecated, please update. New URLs can be found in the footers at https://news.google.com/news

    The Verge

    Google is using software to make the Pixel 3's screen corners even rounder
    The Verge
    Material Theme, an updated version of the company's software design philosophy, is the driving force behind the Gmail and Chrome redesigns of late, and you'll notice it most prevalently in the new Chrome tab design that eschews rough and pronounced ...


    TechCrunch

    Buggy software in popular connected storage drives can let hackers read private data
    TechCrunch
    Security researchers have found flaws in four popular connected storage drives that they say could let hackers access a user's private and sensitive data. The researchers Paulos Yibelo and Daniel Eshetu said the software running on three of the devices ...


    Pinterest's Evan Sharp on the Future of Software
    WIRED
    Over the next few weeks we'll be publishing these taped conversations as a part of the podcast. In this particularly interview, Mike and Arielle ask Sharp what it's like to receive praise from Ive, how machine learning is changing software design, and ...


    Coupa Software Acquires Aquiire For Supplier Catalog Search
    Seeking Alpha
    Coupa has acquired Aquiire for an undisclosed amount. Aquiire has developed a highly regarded B2B eProcurement system. For COUP, the deal should bolster its Business Spend Management platform and provide customers with cost-reduction capabilities ...

    and more »

    GeekWire

    Software company Qualtrics files to go public
    MarketWatch
    Qualtrics International Inc., a Utah-based software company filed for an initial public offering Friday. The company did not yet provide a number of shares it expects to offer or an expected price, but said it plans to raise $200 million, which is ...
    Cloud software company Qualtrics plans to follow rival SurveyMonkey to the public marketsCNBC
    Qualtrics files for $200M IPO, continuing the trend of enterprise software companies going publicGeekWire

    all 11 news articles »

    Motley Fool

    Check Point Software Will Be Checking In With Investors Next Week
    Motley Fool
    Check Point Software Technologies (NASDAQ:CHKP) is dawdling even as the broader cybersecurity market is growing at a solid pace. The cybersecurity specialist has been more concerned with share buybacks and growing its bottom line, even as rivals are ...

    and more »

    Crunchbase News

    Early-Stage SaaS VC Slip Snaps Recovery As Public Software Stocks Soar
    Crunchbase News
    However, the investment boom times didn't necessarily carry over to the seed and early-stage end of the subscription software businesses. The chart below displays deal and dollar volume of seed and early-stage venture investments made into companies ...


    C4ISRNet

    The Army will test new software for its vehicles' computers
    C4ISRNet
    The two software products, which operate on Mounted Family of Computer Systems (MFoCS) hardware, include Frontline v2.0 — the core software that has a common look and with Command Post Computing Environment software — and the Android Tactical ...


    San Antonio Business Journal

    How the military is developing cybersecurity defenses quicker
    San Antonio Business Journal
    When the commercial software market shifted to apps, it was obvious that the old way of developing software had to go. With regular security and capability upgrades now expected by consumers, Silicon Valley companies replaced the traditional lengthy ...


    Health Data Management

    Salinas Valley using Pure Storage software to aid legacy performance
    Health Data Management
    Salinas Valley Memorial Healthcare System in Salinas, Calif., has gone live on software from Pure Storage to improve the performance of legacy applications, as well as supporting a next-generation electronic health record and a picture archiving and ...

    Google News

    Cisco Certification: Introduction To ISDN, Part IV

    In part III of this ISDN primer, we learned that... Read More

    Editing Your Photos Using Microsoft Picture It Publishing Platinum 2002 - A Great Dinosaur

    I started using PIP (Picture It Publishing) Platinum 2002 right... Read More

    How to Make Attractive and Effective PowerPoint Presentations

    Microsoft PowerPoint has dramatically changed the way in which academic... Read More

    Microsoft Business Solutions - Navision Customization: C/SIDE, C/ODBC, C/FRONT, XBRL

    Microsoft bought Navision, Denmark based software development company, along with... Read More

    RSS: Get Notified When Your Favorite Websites Are Updated

    RSS (Really Simple Syndication) is a way for a site... Read More

    Microsoft Business Solutions VAR/Partner Selection ? Overview for IT Director/Manager/Controller

    Microsoft Great Plains and Microsoft CRM become more and more... Read More

    Five Steps to Rapid Development with TierDeveloper 4.0

    Follow the steps below to quickly design, generate, and deploy... Read More

    Programming Language Migration Path

    While I was preparing some personal background information for a... Read More

    Think Of This

    Think of this, first we had the HAM Radio, then... Read More

    Internet Security Threats: Who Can Read Your Email?

    Before being able to choose a secure Internet communication system,... Read More

    Groupware: Answers the 5 Questions of Document Collaboration

    Every organization which creates collaborative documents, whether they are budgets,... Read More

    Microsoft Great Plains RW: Report Writer

    Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More

    Microsoft CRM Implementation & Remote Support

    We would like to give you pluses and minuses of... Read More

    Easy Guide to RAID Recovery

    What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More

    Internet Relay Chat - A Basic Introduction

    What is IRC?IRC is Internet Relay Chat. It is a... Read More

    SpyBot - Search and Destroy versus Microsoft AntiSpyware (Beta).... My personal experiences...

    Ok... Where to start?Well, I guess I will start at... Read More

    Microsoft Great Plains version 8.5: Upgrade, Customization, VBA, Crystal Reports - Highlights

    Microsoft Great Plains is one of the Microsoft Business Solutions... Read More

    Defining OLAP Solutions and Data Warehouse design

    This tutorial covers OLAP solutions used by Data warehouses and... Read More

    New Web-Based HR Tool is Max From NAS, Hannibal, and InfoLink

    Three highly respected names in Human Resources have joined forces... Read More

    How to Evaluate Staffing Software

    If you are in the market for new staffing software,... Read More

    Lotus Notes Domino and Web: Application Development ? Tips for Programmers

    Beginning with Domino version R4 it has integration with the... Read More

    HelpDesk & Asset Management Software - Choosing The Right One

    If you are to buy a HelpDesk & Asset Management... Read More

    Microsoft Great Plains customization ? Freight Forwarding/Transportation industry example

    Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More

    eCommerce development for Microsoft Great Plains: tools and highlights for programmer

    Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More

    Windows x: Basic Windows ?Security? Issues

    Language development computer: Computer-based method for aiding language development seems... Read More