| Add You |
Hubs | Hubbers | Topics | Request |
| #1 in Business | Subscribe Email Print |
|
You are here: Home > Computers and Technology > Personal Tech > 15 Good Programming Habits |
|
Add You - 15 Good Programming Habits
You're Fired! Tips for Avoiding the Termination Blues sk. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place.With almost daily news reports of companies laying off workers, or filing for bankruptcy, or going out of business altogether, losing your job suddenly doesn't sound all that unlikely. Here are some strategies either to avoid being laid-off, or to cushion the blow if it comes.1. Keep your resume current. If you haven't looked at your resume in over a year, drag it out and review it. Make sure you've included your latest work accomplishments and that it adequately represents who you are. Whe 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and ea Ghostwriting - Making Money by Being Invisible 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.My bookcase take up one whole wall in the family room, from floor to ceiling. It shows my eclectic reading tastes... fiction, non-fiction, Harry Potter next to murder mysteries and metaphysical literature. Also there are books I've written for the business sector - on negotiation, writing letters, communication skills, real estate sales and a lot more. The business books, however, have other people's names on them. I'm merely the ghostwriter.These days, I've moved from writing fiction and b 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<10;i++) 2) { 4) printf("i=%d\n",i); 3) } The numbers at the starting of each line indicate sequence of writing loop code. 7. Avoid using magic numbers. For example, instead of writing circleArea = 3.14 * pow(radius,2); use following code: #define PI 3.14 circleArea = PI * pow(radius,2); 8. Use meaningful variable and function names. For e.g. instead of using 'r' use 'radius' to represent radius of a circle. Similarly, function name 'calculateArea' is better than any cryptic short name. In a hurry, we may use short variable names but the time saved leads to double wastage of time later when you guess for what that short variable name stands for. 9. Using print statements for later debugging is a good habit. But, removing them when final code is ready is, sometimes, a risky task. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place. 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and eas How To Get A Home Mortgage Securing the right home mortgage is the most important thing for you to do when considering this large purchase. You should carefully find the right choice for you after comparing all of your options. Yet, when it comes down to it, it can seem like a very difficult thing to actually do. The fact is that many individuals do not know what the right way to get their loan is. Often, they think that their local banker is the only choice, when in fact this is likely to be the most expensive and non-forg 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<10;i++) 2) { 4) printf("i=%d\n",i); 3) } The numbers at the starting of each line indicate sequence of writing loop code. 7. Avoid using magic numbers. For example, instead of writing circleArea = 3.14 * pow(radius,2); use following code: #define PI 3.14 circleArea = PI * pow(radius,2); 8. Use meaningful variable and function names. For e.g. instead of using 'r' use 'radius' to represent radius of a circle. Similarly, function name 'calculateArea' is better than any cryptic short name. In a hurry, we may use short variable names but the time saved leads to double wastage of time later when you guess for what that short variable name stands for. 9. Using print statements for later debugging is a good habit. But, removing them when final code is ready is, sometimes, a risky task. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place. 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and ea 7 Steps To A Flood Of Traffic ered 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:In the world of internet marketing, there is one thing that every webmaster needs in order to be successful, traffic, without traffic you cannot make sales for your products, get clicks on your adsense ads, gain email subscribers or anything else that you may wish to achieve with your website. Traffic is the lifeline of every website on the internet.The following seven methods for generating traffic are proven to achieve results and most can be implemented immediately:Writing article 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<10;i++) 2) { 4) printf("i=%d\n",i); 3) } The numbers at the starting of each line indicate sequence of writing loop code. 7. Avoid using magic numbers. For example, instead of writing circleArea = 3.14 * pow(radius,2); use following code: #define PI 3.14 circleArea = PI * pow(radius,2); 8. Use meaningful variable and function names. For e.g. instead of using 'r' use 'radius' to represent radius of a circle. Similarly, function name 'calculateArea' is better than any cryptic short name. In a hurry, we may use short variable names but the time saved leads to double wastage of time later when you guess for what that short variable name stands for. 9. Using print statements for later debugging is a good habit. But, removing them when final code is ready is, sometimes, a risky task. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place. 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and ea Web Design and CMS - A Good Match, But When? .To use a CMS for your Web Design could be a good idea. There are situations in which you rather would not use one. Here are some advantages and disadvantages.You’d better not choose a CMS for your web site if:The look-and-feel needs to be completely unique. The layout of a CMS is highly recognizable, but also limited by the standard boxes and format that you can choose from. You are free too change colors, switch and move the layout, but a new trendy design will normally not fit int 7. Avoid using magic numbers. For example, instead of writing circleArea = 3.14 * pow(radius,2); use following code: #define PI 3.14 circleArea = PI * pow(radius,2); 8. Use meaningful variable and function names. For e.g. instead of using 'r' use 'radius' to represent radius of a circle. Similarly, function name 'calculateArea' is better than any cryptic short name. In a hurry, we may use short variable names but the time saved leads to double wastage of time later when you guess for what that short variable name stands for. 9. Using print statements for later debugging is a good habit. But, removing them when final code is ready is, sometimes, a risky task. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place. 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and ea How To Write A Successful Article sk. So, make a function that displays debugging information passed to it. When your final version is ready, simply comment the internals of this function. So, this requires changes only at one place.For Internet marketing writing good articles is must. But it is not possible for everybody to write good and effective articles. In most of the websites generally you would have seen only repeated contents. Perhaps you think that you are also not a good writer and you feel writing good an article is a very difficult task.So, how can you develop your writing talent?Read a lot. If you read a lot then you will learn from it by seeing how others have written what you are reading. More yo 10. Once you are done with coding, start optimizing your code. Some of the variables you declared earlier may not be of use at this stage. Similarly, statements which are not loop dependent can be moved out of loop block. Sound knowledge of compiler can also help in optimizing the code further. 11. With good knowledge of your operating system and hardware, you can improve performance of your program in terms of resource requirements etc. 12. Always indent your code for clarity and easy readability. 13. You will also like the idea of organizing project files in into various folders like SOURCE, HEADERS, MAKE, EXES etc. 14. Study the code written by others. This will bring to you new programming techniques and what approach they have followed for the task for which you have also coded. 15. Last but not least important, take backup of your source-code files so that your effort don't go waste if hard-disk crashes or a similar mishappening occurs.
HTTP = HTML link (for blogs, profiles,phorums):
Related Articles:Low APR Balance Transfer Credit Cards - Help You Save Money on Interest Charges Tips for Mortgage Refinancing and Debt Consolidation
|