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

    Alexis limo rentals ..
    In The News:

    A Google DeepMind team has developed an artificial intelligence system that can play video games like a human and take native language commands from players.
    Four of the largest school boards in Ontario, Canada have launched lawsuits against TikTok, Meta, and Snapchat, claiming that they have impacted students' thinking and behavior.
    Finalists for the inaugural Women’s Prize for Nonfiction, aimed at addressing the gender imbalance in nonfiction publishing, were unveiled on Wednesday.
    Tech guru Kurt "CyberGuy" Knutsson breaks down whether the government is watching citizens and what they can do to protect online privacy.
    A benchmarking group for artificial intelligence has released new results evaluating the speed of hardware in running AI applications and responding to users.
    Sierra Space’s Dream Chaser spaceplane provides a glimpse into the future of space travel. Traveling to space may become a part of everyday life.
    The new European Hyperloop Center in the Netherlands aims bring in a new era of transportation. The center will use a steel tube as a proving ground for testing the new vehicle.
    Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
    While it may be incredibly tempting to have a “go with the flow" mindset like the rest of your vacation, your technology definitely should not be compromised while traveling.
    Have you ever accidentally deleted an app from your iPhone that you’ve already paid for? Don't worry. We’ve got a trick that will help you get it back without having to buy it again.
    Apple's new Journal app has raised privacy concerns among Apple's userbase. Tech expert Kim Komando examines social media rumors and explains what steps to take to protect yourself.
    Although Facebook has denied that our phones listen to us, they do have other ways of finding out what we are talking about, listening to and searching for.
    With the integration of OpenAI technology, Figure 01 has taken a significant leap forward, showcasing the potential of robots to understand and interact with us on a personal level.
    Port Ellen, newly reopened whisky distillery in Scotland, is using SmokeDNAi technology to understand mouth-feel and flavors during the whisky maturation process.
    Telly, a smart TV firm, is promising to give out their 4K 55-inch TV for free. What must you give in return? The innovative, yet potentially unsettling, answer might shock you.
    The moment a spam invite hits your calendar, it’s like an uninvited guest at a party. So, what do you do? Show it the door.
    Identity thieves are now targeting children and are making large sums of money by exploiting children's identities, possibly hurting their financial future.
    There's a clever way to change the notification sounds on your Android without having to look at your screen. Kurt "CyberGuy" Knutsson explains.
    If your bank accounted has been hacked, there are a number of steps you can take to prevent it from happening again. Kurt "CyberGuy" Knutsson explains.
    Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
    The Wave House, a data center in Heidelberg, Germany, is the the largest 3D-printed building in Europe. Its walls were built in about 140 hours.
    Some government agencies around the world are struggling to meet their staffing goals when it comes to hiring artificial intelligence experts.
    Google Maps' recent upgrades have introduced real-time ETA and turn-by-turn directions to your phone's lock screen while you are traveling.
    Kat Cammack says AI could disrupt the 2024 election. A report says shared AI image tools generate election disinformation in 41% of cases and voting disinformation in 59% of cases.
    Deepfakes have become commonplace, and the technology is only getting better, but there are certain elements that might give away the fact that an image is AI-generated.

    Unwanted Files

    A LOT OF UNWANTED FILES.When you uninstall an item of... Read More

    What is Spyware? Are You Being Watched?

    Find out why Spyware Removal from computers is important and... Read More

    Windows Screensavers Explained

    In this article you will find some background information about... Read More

    Microsoft CRM Custom Design & Development: SDK, C#, SQL, Exchange, Integration, Crystal Reports

    Microsoft CRM is new player on the CRM software... Read More

    Spyware - The Internet Devil Of Our Times!

    Spyware and Adware infest over 90 percent of computers in... Read More

    Crystal Reports For Microsoft RMS ? Overview For Developer/Report Designer

    If you are software developer or database administrator - we... Read More

    Microsoft CRM Integration with Lotus Notes Domino: Messaging Connector ? Future Directions

    IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More

    Chinese Input - Step by Step Instruction on How to Input Chinese Characters in English Windows XP

    Enabling Chinese input is quick and easy, there are only... Read More

    Microsoft Great Plains: Manufacturing or Bill of Materials - Overview for IT Specialist

    Microsoft Great Plains is main Microsoft Business Solutions product, targeted... Read More

    Navision Sales Module & Reporting: Jet Reports, C/ODBC, XBRL, Business Analytics ? highlights

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

    Microsoft Great Plains Subcontracting ? Overview for Microsoft Business Solutions Partner

    Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More

    Microsoft CRM Integration & Customization: SharePoint Document Gateway

    MS CRM is very close to document workflow automation, including... Read More

    Great Plains Bill of Materials Setup & Customization for Process Manufacturing ? Overview

    Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More

    PHP On-The-Fly!

    IntroductionPHP can be used for a lot of different things,... Read More

    The Truth about Colossus: Are You Just A Magnetic Image?

    What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More

    Microsoft CRM Customization: Integration with Third Party SQL Application/Database

    Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More

    A Symons Mark II Function Point Counting Example

    I provide, here clear explanations and a count of function... Read More

    Guide to Software Marketing

    Intro This concise article will tell you in plain English... Read More

    Windows x: Basic Windows ?Security? Issues

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

    What is Shareware?

    Shareware is software that you can try before you buy;... 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

    How the Firefox: How to... Manual Helped Me

    A few months back I really got sick of my... Read More

    The End of Spyware?

    The US House of Representatives has recently passed the "Spy... Read More

    Database Guru James F. Koopmann Reviews DBxtra Reporting and Query Tool

    DBxtra is a powerful query and reporting tool that hides... Read More

    Microsoft Great Plains Partner Selection: Overview

    Microsoft Great Plains, Navision, Solomon and Axapta are Microsoft Business... Read More

    car service from Midway Alsip ..