www.1001TopWords.com |
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 |
RELATED ARTICLES
How to Save an Image in a SQL Server Database? Most of the web applications have a lot of images used in it. These images are usually stored in a web server folder and they are accessed by giving the relative path to the file with respect to the root folder of the website. .Net being the platform for distributed application now, ASP.Net can be used to store images that are small to be stored in a database like SQL Server 2000 and later versions. For this purpose the SQL Server database provides a data type called "image" which is used to store images in the database. Best PC Pocket GPS Stop Getting Lost Is Online DVD Rental or Pay-Per-View the Best Way to Get Your Movies? With renting methods such as online DVD rental and pay-per-view, it seems almost old-fashioned to go to the rental store. But with all the different ways to get the latest movies, which way is the best? Well, that depends on what is important to you. Here are some of the different ways you can get the latest movies and the pros and cons of each. 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 your machine, and you are the only user on this machine. That is right, no one else uses your computer except you. Freezing - Time To Warm Up Your PC Freezing is also known as crashing or hanging. It's frustrating. The computer locks up and the mouse and keyboard do not respond. You may lose data and you certainly lose time and patience. Typically, you need to press Ctrl+Alt+Del to see the programs that are running and to try to close the program that is not responding, or you need to force a restart. So why does your computer freeze up? Help, I Need a New HDTV! (Part 1 of 5) Feeling overwhelmed in selecting a new TV? With all the choices these days, you may feel like, "Where do I start?!" Basic Computer Thermodynamics That desk in front of you and everything else around you is made up of atoms. An atom consists of electrons orbiting around a nucleus. An atom is increadibly tiny. You could line up 10 million of them inside a millimeter. What if we could scale up an atom so that the nucleus was the size of a basketball? The orbits of its electrons would then be 15 miles away. Some Thoughts on Choosing a Flash MP3 Player Flash mp3 players come with an exciting array of features, and can be used for more than playing music while you cycle at the gym. Here are some things to think about when purchasing a flash mp3 player, which might make the difference between your choice becoming an indispensable tool, or just another gadget. Is Digital Camera Technology Making Film Obsolete? Perhaps not yet, but the handwriting might be on the wall? More Cool Web Tricks If you ask most people what frustrates them most about the Internet, many of them will tell you "It's the little things!" Build Your Own Computer I'm eighty-one years old and I bought my first computer six years ago. When I bought it I hardly knew how to turn it on. I consider myself still a Newbie as I've barely scratched the surface of computer technology. I have successfully built about a dozen computers for family, friends and myself. I have even sold a couple of them. Reliable File and Folder Sharing in Windows Xp This tip is on sharing files and folders on a local network in Windows XP. It has been tested on Windows XP Professional (with and without SP2). FTP - File Transfer Protocol Explained File Transfer Protocol (FTP) is a protocol that is part of the TCP/IP suite. It is the standard for transferring large amounts of data from server to server and from servers to clients. There is a very good chance that you have downloaded files from FTP sites many times, though it may have seemed you were only downloading from a website. FTP allows you to transfer files over a variety of hosts with different operating systems and file systems. There are so many FTP servers on the Internet, some are private with secure logon names, other ones are public with anonymous logins. Computer Geeks and Garden Gnomes First and foremost before I begin my ranting it is worth mentioning that there are many very helpful and considerate people out there in the cyber wilderness who devote much of their time to providing open source and free scripts of all variations from PHP, CGI and Java to name but a few. They provide dedicated support, do not insist on payment, and spend much of their free time helping you avoid having to part with your hard earned cash to get free programs and scripts up and running on your websites. 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 the transistor radio, portable tape and CD player days. Most players are no larger than a deck of cards. Eliminating the need to lug around tapes or CD's, digital music players re-define convenience and portability. EDTV vs HDTV Confused by EDTV vs HDTV? We don't blame you. The number of acronyms floating about with regard to digital TV is frightening. What's even more worrying is that very often they are used by people who have little or no knowledge about what they mean. If the person selling you doesn't know the difference between EDTV vs HDTV, how are customers supposed to decide which TV or projector to go for? Help, I Need a New HDTV! (Part 4 of 5) Feeling overwhelmed in selecting a new TV? With all the choices these days, you may feel like, "Where do I start?!" Toshiba Wins Hollywood Support for the HD DVD format What led them to this choice, as all four studios stated separately, is better performance for the price and copyright protection. Image Formats: GIF, JPEG, BMP When browsing the internet you are likely to come across many different image formats. However, the most common formats are: CompuServe GIF, JPEG, and Bitmaps. Web Standards HTTP Protocol |
© Athifea Distribution LLC - 2013 |