Some best practices which one should always follow while coding in Visual Basic. These practices will allow smooth programming and prevent intensive debugging.
- Avoid ‘magic numbers‘ when you can. Use constants instead.
- Be modular.
- Defensively program.
- Ideally, VB procedures should have only one purpose.
- Deep nesting of loops should be avoided.
- To protect sensitive data use access procedures.
- The variables should always be defined with the smallest scope possible.
- Don’t pass global variables to procedures.
- Use “&” operator when linking strings and the “+” operator when working with numerical values.
- While creating long string, underscore “_” line continuation character should be used to create multiple lines of code.
- Variants should be avoided if possible.
- As per Microsoft’s recommendation, code should be indented with four spaces.
- Finally, watch out for mis-spelled variables.
Enjoy good programming in Visual Basic.






![6 Must Read Articles on the web Jan 29 – Feb 4, 2012 : [Knowliz Weekly]](http://www.knowliz.com/wp-content/uploads/2012/01/business-articles-50x50.jpg)


New post, Best Practices of Programming in "Visual Basic" – http://t.co/iPu4px0f #in