Saturday, December 4, 2010

Tips...

Never Fell in Love with Your Clients…
You never know when they take U Turn

--Jamal

Friday, December 3, 2010

Top 10 Tips For Programmers

When you start programming then you must take care of the following points: 

1. Set your goal and make estimates : It happens many times that we start designing and writing our applicationwithout setting our goals. After the release of application some problems may occur like out of memory problem, performance issues, scaling etc. Try to make an estimate to avoid these problems in advance.

2. Human readable code : A programmer should make human readable code. For a complier it does not matter if you use a single letter identifiers or a more human readable identifiers, if you write optimized expression or more human readable simple expressions. Compiler does not take long time to compile longer identifiers. 

3. Write small routines : In past few years, methods are made much smaller. Methods are small enough to accomplish a task and can be understood in a short time. Long methods are difficult to understand, debug and maintain. These long methods are difficult to test.
4. Avoid premature optimization : Sometimes programmer thinks that the clever code is difficult to reador to comprehend. Programmer should write their code clearly and cleanly. After that they should find out where the bottlenecks are and optimize them. 

5. Try to avoid global variable : Global variables are made once and can be used in all methods. These are v isible to everywhere. This is a great feature as well as worst too. A programmer has no control, that who is changing or accessing the variable. Local variables provide more control over the program. 
6. Try to avoid looping problem : Sometimes loop index is incremented irregularly. That’s why a loop is traversed an incorrect number of time. Some times one may forget that an array may be zero based and some time one based. To avoid such problem, some programming languages are providing for…each loop. Programmers can use functional programming technique called “Map” to avoid this problem. 

7. Handle exceptions : Many languages use an exception system. These languages use the keywordslike throw, try, catch, finally etc. Exceptions have the ability to unwind the stack, automatically returning from nested routines until the exception is trapped and dealt with. Programmers should be clear to the type of exception they catch. 

8. Validate user input : Earlier our input validations were limited to number validations, date validation, text validation etc. Malicious users could enter data into your program to take control over your applicationor your server. The most famous is SQL injections and XSS attacks. So validate your application for all type of possible hacker input also. 

9. Be up to date with technologies : Programmers should try to be knowledgeable and should maintain their expertise. They should learn about new techniques. New techniques, that are of equal or greater importance. 

10. Write documentation : Try to write more and more comments or explanation for our code. Documentation will help you and others to understand your code. But do not store secret information like password etc in your application.