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:

Yahoo! News: Top Stories

United Auto Workers members listen to UAW President Ron Gettelfinger speak at a news conference at a meeting of UAW officials in Detroit, Wednesday, Dec. 3, 2008.  (AP Photo/Paul Sancya)AP - The United Auto Workers said Wednesday it is willing to change its contracts with U.S. automakers and accept delayed payments of billions of dollars to a union-run health care trust to do its part to help the struggling companies secure $34 billion in government loans.



President-elect Barack Obama speaks at a news conference in Chicago, Wednesday, Dec. 3, 2008. (AP Photo/Charles Dharapak)AP - President-elect Barack Obama signaled a clear desire Wednesday to use a significant portion of $700 billion in financial bailout funds to stanch foreclosures by helping struggling homeowners with their mortgages. "The deteriorating assets in the financial markets are rooted in the deterioration of people being able to pay their mortgages and stay in their homes," he said.



A bomb disposal squad officer, center, takes a suspicious box to the police station after diffusing a bomb at Chhatrapati Shivaji train station in Mumbai, India, Wednesday, Dec. 3, 2008. Police on Wednesday discovered leftover explosives hidden in a bag in Mumbai's main train station, a stunning new example of botched security after the deadly rampage that left the government open to accusations it missed warnings and bungled its response. (AP Photo)AP - Police searching a mound of baggage abandoned amid the carnage of the attack on Mumbai's main train station found two bombs Wednesday — nearly a week after they were left there by gunmen — in a stunning new example of the botched security that has become a major issue in India since the three-day siege.



In this Thursday, June 19, 2008, file photo, former Florida Gov. Jeb Bush answers questions at the Excellence in Action conference, a national summit on education reform, in Lake Buena Vista, Fla. Still popular in Florida, former Gov. Jeb Bush said Wednesday that he's interested in the seat Sen. Mel Martinez is giving up, and the field of possible candidates could quickly narrow to make way for the president's younger brother. (AP Photo/John Raoux, File)AP - Still popular in Florida, former Gov. Jeb Bush said Wednesday that he's interested in the seat Sen. Mel Martinez is giving up, and the field of possible candidates could quickly narrow to make way for the president's younger brother.



Pirates ride alongside the luxury American cruise ship M/S Nautica, in this photo take from the Nautica, during a hijack attempt on the vessel, off the coast of Yemen in the Gulf of Aden, Sunday, Nov. 30, 2008.  The M/S Nautica, carrying 656 international passengers and 399 crew members, was sailing through the Gulf of Aden on Sunday when it encountered six bandits in two speedboats.  The pirates fired at the passenger liner but the larger ship was faster than the pirates' vessels, and escaped being boarded.(AP Photo)AP - Ordered to get inside and stay down, Oregon tourist Clyde Thornburg heard the pirates' rifle shots hit the side of the luxury cruise liner — "Pop! Pop! Pop!" — then felt the ship speed up to escape.



This undated photo provided by the Tracy Police Department shows Caren Ramirez. Police were seeking Ramirez on suspicion of participating in alleged abuse against her 17 year-old nephew who showed up Monday, Dec. 1, 2008 at a northern California gym with a chain locked to his ankle. (AP Photo/Tracy Police Department)AP - The aunt and one-time guardian of an emaciated and shackled 17-year-old has been arrested, as police tried to determine how she knew the couple accused of holding the teen against his will for nearly a year.



University of California, Los Angeles, Professor of Psychiatry  Dr. Gary Small plays with a digital memory electronic device at his office at the Semel Institute for Neuroscience & Human Behavior in Westwood, Calif., on Monday, Dec. 1, 2008. (AP Photo/Damian Dovarganes)AP - What does a teenage brain on Google look like? Do all those hours spent online rewire the circuitry? Could these kids even relate better to emoticons than to real people? These sound like concerns from worried parents. But they're coming from brain scientists.



This undated file photo provided by the Illinois Department of Corrections shows Jennifer Hudson's estranged brother-in-law William Balfour. Balfour has been arrested Monday, Dec. 1, 2008 in Illinois in the deaths of the singer's mother, brother and 7-year-old nephew. (AP Photo/Illinois Department of Corrections)AP - Prosecutors allege Jennifer Hudson's estranged brother-in-law killed three family members because he was angry the singer's sister was dating another man.



AP - The one that didn't get away held an unlikely surprise for a Texas man. The blue-stoned class ring of Joe Richardson, engraved with his name, turned up inside an 8-pound bass 21 years after he lost it while fishing on Lake Sam Rayburn.

AP - Dustin Pedroia has a Rookie of the Year award, an MVP, a Gold Glove and Silver Slugger and, of course, a World Series ring.

General Motors employee Eddie Webster rests his hand against a new Chevy Tahoe at a rally held to support federal aid to the U.S. auto industry at the GM assembly plant in Arlington, Texas, November 18, 2008. (Jessica Rinaldi/Reuters)Reuters - President-elect Barack Obama said on Wednesday struggling automakers have put forward a "more serious" restructuring proposal to Congress but withheld judgment on the plans until hearings are held.



Trading specialists work on the floor of the New York Stock Exchange, December 3, 2008. (Chip East/Reuters)Reuters - Record declines in the vast U.S. and European service sectors and more bleak U.S. employment news on Wednesday sparked fear of an economic "free fall," setting up another round of deep interest rate cuts.



Posters are displayed close to Taj Mahal hotel in Mumbai, December 2, 2008. (Arko Datta/Reuters)Reuters - U.S. Secretary of State Condoleezza Rice urged Pakistan on Wednesday to cooperate "fully and transparently" in investigations into the Mumbai attacks that have upset India-Pakistan relations.



An employee works on a 2009 Ford F-150 on the assembly line at Ford's Kansas City Assembly Plant in Claycomo, Missouri, October 2, 2008. (Sam VarnHagen/Ford/Handout/Reuters)Reuters - All options were on the table on Wednesday as congressional committees scrutinized auto company restructuring proposals and an urgent appeal for $34 billion in aid ahead of make-or-break hearings.



The U.S. Senate and Congressional Democratic leadership attends a Democratic Senatorial Campaign Committee/Democratic Congressional Campaign Committee election watch party in Washington November 4, 2008. From L-R are: DSCC Chairman Sen. Charles Schumer (D-NY), House Majority Leader Steny Hoyer (D-MD), Senate Majority Leader Harry Reid (D-NV), DCCC Chairman Christopher Van Hollen (D-MD), and Speaker of the House Nancy Pelosi (D-CA). (Larry Downing/Reuters)Reuters - Senate Democrats will be able to do plenty over the next two years -- despite falling just short of their goal of winning a majority big enough to end Republican procedural roadblocks.



Treasury Secretary Henry Paulson speaks at a news conference at the Treasury Department in Washington, November 25, 2008. (Jason Reed/Reuters)Reuters - Treasury Secretary Henry Paulson is weighing whether to ask Congress for the remaining $350 billion of the financial bailout fund, with White House aides approaching President-elect Barack Obama's transition team about the idea, an Obama aide said on Wednesday.



A U.S soldier stands guard during a graduation ceremony at Al-Furat Iraqi Police Training Center in Baghdad December 2, 2008. (Saad Shalash/Reuters)Reuters - A string of departures by the U.S. military's allies in Iraq is turning into an exodus as violence subsides and the end of a U.N. mandate permitting their deployment to the country approaches.



Tourists from Greece pose as they exit an Thai Airways flight from Phuket, the first to land at Bangkok's Suvarnabhumi Airport December 3, 2008, after a week long anti-government protest paralyzed air travel. (Chaiwat Subprasom/Reuters)Reuters - Anti-government protesters lifted their crippling, eight-day blockade of Thailand's main airport on Wednesday, raising the hopes of 230,000 stranded tourists even though there is no end in sight to the wider political crisis.



A map locating the main terrorist attacks in Mumbai. India on Wednesday warned that all options were open in dealing with Pakistan after last week's attacks on Mumbai, as the United States pressured Islamabad to show urgent cooperation with the probe.(AFP/Graphic)AFP - India on Wednesday warned that all options were open in dealing with Pakistan after last week's attacks on Mumbai, as the United States pressured Islamabad to show urgent cooperation with the probe.



Children go to fetch water at a plant in the Zimbabwean capital, Harare, on December 1, 2008. Baton-wielding riot police broke up protests in Harare and detained dozens Wednesday, as the death toll of a cholera epidemic neared 600 in Zimbabwe's worsening health and economic crises.(AFP/File/Desmond Kwande)AFP - Baton-wielding riot police broke up protests in Harare and detained dozens Wednesday, as the death toll of a cholera epidemic neared 600 in Zimbabwe's worsening health and economic crises.




Help, I Need a New HDTV! (Part 3 of 5)

Feeling overwhelmed in selecting a new TV? With all the choices these... Read More

Cisco CCNA Certification: Five Things To Do DURING The Exam

There are plenty of articles out there about how to prepare for... Read More

What Exactly are Screensavers? - part II

Here are some tips on how to use screensavers:First of all you... Read More

Lightning Season: How to Avoid Data Loss

We have just entered the time of year that most electrical storms... Read More

Compare MP3 Players for the Coolest Features and Sweetest Deals

How can you compare mp3 players to be sure you're getting the... Read More

Looking For an MP3 Player?

If you don't have an mp3 player, and even if you do,... Read More

Improve PC Performance - 6 Tips You Must Know

Are you frustrated with your PC?Is it feeling sluggish or crawling at... Read More

How To Remove One Operating System from a Dual Boot Windows XP Computer

In Windows Xp, you can install two operating systems on the same... Read More

Is Digital Camera Technology Making Film Obsolete?

Perhaps not yet, but the handwriting might be on the wall?How is... Read More

Computer Geeks and Garden Gnomes

First and foremost before I begin my ranting it is worth mentioning... Read More

What Does That Error Message Really Mean?

Surf the 'Net for about 10 minutes and chances rate very high... Read More

Dynamite Comes in Small Packages - Tiny Personal Audio MP3 Players Pack Powerful Music Enjoyment

MP3 players are Hot! Playing music has come a long way since... Read More

Repairing A Corrupt .RAR/.ZIP Archive

Step 1:Open WinRAR and browse to the folder with your .rar/.zip file.Step... Read More

The Benefits of Open Source

If you are a building a website or a forum, chances are... Read More

Are You Well Protected?

Winter?the official start of the cold and flu season. Though, technically speaking,... Read More

5 Ways to Speed Up Your PC

No matter how fast your processor and regardless of how much ram... Read More

Some Thoughts on Choosing a Flash MP3 Player

Flash mp3 players come with an exciting array of features, and can... Read More

Gain Control Over Your Screensavers With These Simple Steps

We all enjoy our favorite screensavers but in the same time we... Read More

Temporary Fixes to Spyware, Ad-ware, and Virus Infections

So you've got some spyware, ad-ware, or viruses on your system. For... Read More

HTML Explained: Part 1

Want to save money while promoting your web-based business? Of course you... Read More

A Beginners Guide to Avoiding Viruses

"Aaaaaahhhhhh! I've been invaded by a virus!" Getting a virus means getting... Read More

The Importance Of Email Backup

Viruses, software failures, power failures, human errors, hard drive failures are only... Read More

What Are You Looking For In A Cheap MP3 Player?

Are you stymied by the vast offerings in cheap mp3 players? Don't... Read More

Best PC Pocket GPS

Stop Getting LostOne of the greatest uses for a pocket pc is... Read More

EDTV: What You Should Know Before You Make That Purchase

Enhanced Definition Television ? also known as EDTV ? is one of... Read More

SmartCar Memory Stick for LapTop Transfer Data

With the new technology used to transfer information to from your digital... Read More

The Newbies Guide to Personal Computer Maintenance

When you turn on your computer, does it act like it needs... Read More

How To Safeguard Your Computer?

The following practice, if done regularly, may help you to safeguard your... Read More

Keeping Passwords Secure

As the web has evolved, so have the methods of collecting personal... Read More

How to Buy a Plasma Television Set

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

Cisco Certification: What To Expect On Exam Day

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

Tips For Finding Great Deals On Computer Accessories & Supplies

Tip #1. Do a Google search. Don't be to general in your... Read More

Ergonomics and Healthy Computing - Positioning Your Body For Maximum Comfort At Your Computer

Do you remember the old saw about how computers would change our... Read More

Smart Apple iPod Tips and Techniques

Are you thinking of buying an Apple iPod? Or have you bought... Read More

If You are the Only User on Your Windows XP Computer, Do You Think One User Account Is Enough?

I am going to assume that you are running windows xp on... Read More

Choosing a Portable MP3 Player: Part 1

MP3 players are everywhere! It seems that the number of makes and... Read More

EDTV vs HDTV

Confused by EDTV vs HDTV? We don't blame you. The number of... Read More

How to Protect your PC from Spyware in the Cyber Age

Wouldn't you be shocked to find that your personal sensitive information, like... Read More

The Many Benefits of Owning a DVR

Has This Ever Happened To You? OK.. it's Friday night, the kids... Read More

Nephrology and Dialysis For a PDA

Saving Lives With A Pocket PCFree medical downloads can be a real... Read More

Help, I Need a New HDTV! (Part 1 of 5)

Feeling overwhelmed in selecting a new TV? With all the choices these... Read More

4 Easy Ways to Speed Up A Sluggish PC

Computers are supposed to speed up our productivity?to help us do more... Read More

Cisco Certification: Taking Your First Certification Exam

Youâ??ve studied hard; youâ??ve practiced your configurations; youâ??ve used your flash cards... Read More

Why Build Your Own Computer System

Have you ever thought about building your own computer system? Maybe you've... Read More

Getting Started with HTML

The basic language of the internet is html. If you can do... Read More

This Page Cannot Be Displayed ? What to Do When Your Internet Breaks

The DNS (Domain Name System) servers are what your computer uses to... Read More

How To Speed Up Your Aging PC And Make It Healthier Too

With a little tweaking and with proper tools, you can get a... Read More