Part– II : Coding standards



These are the main checklist I used to follow in day to day code development and maintenance. Hope this might help some of you new people. If there is any mistakes/typo please do not hesitate to comment. Coz these are my personal views and opinions

1. Need to avoid unnecessary comments especially while releasing a build
2. Reduce as much lines of code as possible
3. if a variable is used only once then declare it locally if possible
4. Follow the naming conventions especially in DB layer. This helps a lot I promise :)
5. Method name should tell what it does. Do not use miss-leading names. If the method name is obvious, there is no need of documentation explaining what the method does
6. Make a note or summary at top of the page if the code was developed my multiple persons. it helps to track when and which kind of development started
7. Make sure that the required input values gets logged while logging the error message in catch block
8. Avoid unnecessary references and using’s
9. Dispose the objects properly and completely especially while COM programming
10. Prepare the project structure like so you need to reuse it for other projects where ever necessary. Hope you guys will be smart enough to change the names as of need. And enjoy the slag times to improve your logic.
11. Avoid a ladder of IF loops. make sure your process flows as if – else
12. Your code looks beautiful and reflects your cleanliness & discipline. if there is a need of huge method just either split it in to different sub-methods or put a #region’s accordingly for hectic scrolling while debugging
13. For beginners, while typing every fragments of code question yourself why we need it. Don’t believe in Google for while at least :)
14. Your project structure should be very perfect. and folder structures
15. if there is any need of hard coding. try using them as a variable or an enum. so that while reviewing/code release it will be easier
16. Never assume that your code will run from drive "C:” You may never know, some users may run it from network or from a "Z:”
17. Don’t take it as granted that end-users will understand what ever pop-up’s you show. make sure that meaningful and helpful messages were shown. it must be short and simple
18. Also make sure that if you learn something new try to implement it where ever it is possible and acceptable in your logics
19. And unit testing; Read about the business logic of the thing you developed and behave as you are an end-user of it.
     1. Blindly don’t write code for 1+2=3. it will work for you in development. But will it work for an end user while giving a huge values?
20. :) This is for smart geeks…
     1. what ever you learn it should be one of the weapon in your armory.
     2. Do not compare with other programmers and disrespect yourselves. Every programmer will have their own pro’s & con’s
     3. Improve your presentation skills.
     4. get/create an opportunity to interact with customers and the sales professionals, analysts within    your industry. You will get to know the current market trends…. who knows it might create an new opportunity.
     5. In the IT world higher managements wont allow you to do coding after some time. you must lead people later on. Do not hesitate or have a valid reason and try to overcome it before accepting driver seatRegularly attend for interviews or interact with the people who are in other companies or in other projects
     6. Make sure you are preparing for interviews daily. Love your job not the company you work for
21. Try to get a clear picture while doing any career shift. whether it might be an onsite opportunity within your company or a new job
22. if you are going for an onsite don’t think like you are working for the same company. the dealings will be completely different and money matter 
23. Last but not the least every other developer must be your friend. And none of the KT process is perfect. That’s a fact and that’s a major risk. So make sure that your code talks and helps the other developer to carry on from where you had left it.

So happy coding guys..  :) :)

Regards,
P@’1’




Comments

Popular posts from this blog

Download file using WCF REST services

server side printing / PDF conversions using c# and asp.net/wcf service

Finding file size in bytes on serverside using c#