![]() |
|
|
#1 |
|
Senior Member
Join Date: Aug 2011
Posts: 111
|
While developing larger software application, there will be multiple programmers involved. And every programmer has different style of coding. Due this fact, the application developed will be inconsistent in terms of Readability, Integrity, Maintenance, etc. Also, it will take much time to new programmers to understand the code, functionality flow fully.
To overcome with such problems, everyone needs to be on the same page before jumping into programming. And all the programmers must follow common coding standards which we refer as 'best coding practices'. The best coding practices ensure the use of common standards and uniform coding, reducing errors and the time spent in code review. Here are 5 important coding practices which every programmer should follow: 1. Start with a plan First make a plan on what to do and how you do, then only start coding. Prepare algorithms (steps) for the functionality and then implement same through coding. 2. Proper Naming Convention Follow proper naming convention while creating files, classes, functions, objects, variables, etc. 3. Make the codes readable Use proper comments, Code Indentation and Placement of braces. 4. Apply security measures Protect from SQL Injection, Allow only valid input, Keep the structure/flow simple. 5. Validation of users input - Trim (remove all white-spaces from the beginning and the ending of a string) - Empty Check (Check for mandatory inputs) - Special Characters Check(Single and Double quotes, slash, Tilt [~]) - Checking format of input [see below.] - Duplicate Check Input Formats Numeric (Integer, Decimal) Alpha Only Valid Email Date Format Time Format Valid IP That's All. Thank you for reading. If you have any feedback or suggestion to improve this thread, plz do not hesitate to post. Your valuable comments/feedback are always welcome. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2011
Posts: 131
|
Thanks kaman, for the informative article. Please keep it up
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2011
Posts: 111
|
Thank you, Sir
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Nice this help for us how to start programming good!
|
|
|
|
![]() |
| Tags |
| best coding practices, best practices, coding tips |
| Thread Tools | |
| Display Modes | |
|
|