15 Good Programming Habits

1. Before sitting down for coding, you must have formal or a paper-napkin design of the solution to be coded. Never start coding without any design unless the code is trivial one.

2. Good code documentation is as important as good knowledge of a programming language. Write brief logic for each major block of your code as comments in source code file itself. Its good to mention creation and modification dates of your program along-with why modification was required.

3. Maintaining versions of your program is another important task. Some present-day programming tools already have a built-in version management. Whenever you make any change to your program, they save its copy as .bak file.

My approach is to maintain 3 versions of a program. Say, I have a file program.c which is used by other project team members also. I copy this file as program.c.old as backup and make another copy as program.c.wrk where I do modifications. When modifications are successfully compiled, replace program.c with .wrk file.

You can also append a date or some explanation phrase to your program versions like program260505.c or programReadFnWrking.c .

4. If your project contains multiple source files then maintain a README file stating purpose of each source files, data files, intermediate and log files (if any). You may also mention the compilation and execution steps.

5. Ever wondered why your IF statement is not working as it should do. May be your are using single equal i.e. "=" instead of "==" in the condition check. A good approach is to write condition in reverse order. So, your condition should read something like this:

if ( 10==i) .... So, if you put single equal sign by mistake then it will be detected at compilation time only as an error.

6. While using loops and conditional statements, always first put closing braces corresponding opening braces and then write the inner statements i.e.

1) for(int i=0;i

In The News:

How to Reduce Credit Card Fraud  The New York Times

Digital Cameras: How Many Pixels Do I Need?

With the bewildering number of digital cameras on the market,... Read More

4 Computer Money-saving Tips

Tip #1 -- Rebates: A rebate is not always a... Read More

Troubleshooting Computer Freeze (Lockup) Problems

How familiar does the following sound? Your computer was working... Read More

Passwords and the Human Factor

Passwords have a strange dual nature. The stronger and safer... Read More

Is DVD Storage An Attractive Alternative For Your Computer Backup?

If you have a computer for home use or for... Read More

Cisco Certification: Building Your Own Home Lab, Part I

CCNAs and CCNA candidates hear it all the time: â??Get... Read More

Flash Memory, Part I: MMC and SD

MMC and SDFlash memory is available in so many formats... Read More

JVCs First Three-Layer Combo-Disc Blu-Ray / DVD

JVC developed and used a high-performance reflective film to produce... Read More

Cisco Certification: What To Expect On Exam Day

Cisco Certification: Taking Your First Certification ExamYou've studied hard; you've... Read More

Have You Invited A Spy Into Your Computer?

Yes, it's true. You may have inadvertently invited a spy... Read More

A Peek Into the Near Future of Electronics Technology

How long do you think DVDs have around? 20 years?... Read More

How to Set Up Simple File Sharing WinXP

The first step is: Start > My DocumentsSo you have... Read More

SOBIG.F Virus Promises Ill Be Back

On 21 August 2003 Symantec Security Response upgraded the W32.SOBIG.F... Read More

Desktop Security Software Risks - Part 2

This is the third in a series of articles highlighting... Read More

How to Buy a Plasma Television Set

Most people think that all you have to do to... Read More

How to Place Home Theater Speakers

You have your television and home theater receiver; you just... Read More

Cisco Certification: Building Your Home Lab, Part II

In the first part of this home lab tutorial, CCNA... Read More

Linux Power Tools - Great Tools to Make System Administration Easy

World War II - Germany decided to attack Poland. Poland... Read More

Lives With Games Tradition and Industry

The United States Of America citizen feels that games is... Read More

Cisco Certification: A Survival Guide To The Cisco Cable Jungle

One of the most confusing parts of beginning your Cisco... Read More

Use Your Computer For Your Entertainment Needs

By using your computer today you can find a lot... Read More

Why Using an Ad Blocker Can be a Bad Idea

Ad Blocking is getting to be a common sport on... Read More

COOKIES - What Are They!!

Cookies, not the kind that Mom makes, but the computer... Read More

How to Use SQLXML to Retrieve Data from SQL Server Database?

Using SQL Server 2000 and above versions you can retrieve... Read More

Cisco Certification: The Most Important Cisco Study Youll Ever Do

All of us are familiar with the pyramids of Egypt.... Read More