ComputerHunter.org

 

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





Google News - Top Stories

Unemployment Rate Rises to 6.1%
New York Times - 44 minutes ago
By MICHAEL M. GRYNBAUM The unemployment rate jumped to 6.1 percent in August, its highest level in five years, pushing the job troubles of American workers onto the political stage as the presidential campaign enters its final eight weeks.
Jobless rate at 5-year high Reuters
Bonds rise on labor woes CNNMoney.com
Wall Street Journal - Bloomberg - MarketWatch - guardian.co.uk
all 773 news articles


Sydney Morning Herald

McCain, Obama Vie For 'Reformist' Mantle
Washington Post - 1 hour ago
By Jonathan Weisman When Sen. John McCain introduced Sarah Palin as his running mate last week, he declared they would "beat the long odds to win a tough election on a message of reform and integrity.
Video: McCain: Change Is Coming CBS
Republicans: Obama is 'more of the same' Boston Globe
guardian.co.uk - Salon - Taipei Times - AFP
all 1,141 news articles


Ghana Broadcasting Corporation

Rice lands in Libya on historic visit
CNN International - 1 hour ago
Rice will hold a landmark meeting with leader Moammar Gadhafi, once dubbed by President Ronald Reagan as "the mad dog the Middle East.
Video: Inside Story - Rice visits Libya - 03 Sep 08 - Part 1 AlJazeeraEnglish
Gaddafi welcomes 'darling Leezza Times Online
AFP - BBC News - AllAfrica.com - Aljazeera.net
all 988 news articles


ABC News

Carolinas Brace for Tropical Storm
New York Times - 57 minutes ago
By KEVIN SACK WRIGHTSVILLE BEACH, NC - With wary eyes cast at Hurricane Ike farther out at sea, coastal Carolina residents on Friday morning prepared for gusting winds and torrential rain as Tropical Storm Hanna sped toward them.
Video: NC Gov.: Hanna Will Affect Most of the State AssociatedPress
Hanna Aims at US East Coast as Hurricane Ike Looms Behind Bloomberg
Bizjournals.com - National Geographic - StarNewsOnline.com - WLOS
all 2,586 news articles


Voice of America

New helmsman for Pakistan's war on terror
Christian Science Monitor - 56 minutes ago
By Mark Sappenfield | Staff writer of The Christian Science Monitor New Delhi - Saturday's presidential election in Pakistan looks set to put a nation coping with Al Qaeda and Taliban strongholds into the hands of Asif Ali Zardari.
Pakistani Lawmakers Set to Elect Next President Voice of America
Pakistan parties begin final push for presidential votes AFP
BBC News - The Associated Press - CNN International - International Herald Tribune
all 1,392 news articles

Google
 

Copyright © 2006 Computer Hunter - A Division of Arthur´s Job Base