Home  /  Computers



  Print this article
  Email to friend
15 Good Programming Habits
Author:

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

   ( Next Page )


Rate this article:  (No ratings yet)

 Saving ...

RECENT ARTICLES FROM COMPUTERS CATEGORY
Help! I Lost My Website! (Author: Edward Sodor)

Have you ever accidentally deleted a file on your computer? Was it important? Did you suffer? Well, imagine if your whole website got deleted! This could happen in any number of ways:You ...


Fight The Hunters - Get A Shield Against Spam (Author: Ted Peterson)

In their residential laboratories they cook industrial amounts of spam following special spam recipes and use these dangerous weapons to waste your days and living powers! Meet it face to face: ...


How To Play Movie On PSP: 2 Methods Exposed (Author: Nash Burns)

There are 2 ways on how you can get to play movie on PSP. Both options have their own advantage and disadvantages and in all practicality you can use both methods.Play Movie On PSP : Method ...


What if there was No SPIT on Your VoIP (Author: Lance Winslow)

Well just when you thought you had SPAM under control with your IP Filters, change of email address, and SPAM Blockers here comes SPIT. But this is not the organic type, no this is a real threat and ...


Satellite Radio: Something I Never Knew I Was Missing (Author: Matthew Payne)

Who in their right mind pays for radio? That's what I was thinking... until I got Sirius as a gift. It was an odd coincidence actually. A few days before I received my Sirius unit and subscription, ...


SEARCH
Search for:


In:


NEWSLETTER
E-mail address:


Name:


Copyright ©2007 HyperArticles.com. All Rights Reserved. - Privacy Policy - Disclaimer