Problem solve Get help with specific problems with your technologies, process and projects.

Coding standards for .NET

Discussion of standards issues.

What do coding standards do for you? Well, the most important thing is that they ensure your code will be compatible with other code that runs in your target environment. Without standards, the world of coding languages would be a veritable tower of Babel. So it is with .NET, but more so. In .NET, you can use a lot of different languages, so standards are more important than ever. This tip, excerpted from InformIT, discusses some of the coding standards issues in .NET.


Apart from the usual purposes for which coding standards are developed, many people using the .NET platform have some other very specific needs with regard to coding standards. The main requirement is ensuring some consistency between the many languages (ever increasing!) that can be used in a .NET environment. In the Java world, JSP is based on the same Java language used by applets, servlets, and EJBs. In a .NET environment, by contrast, it's likely that more than one development language will be used, and it's crucial to realize the effects that these different languages could have on the (lack of) consistency of coding standards. Coding standards must reflect all the languages in the .NET environment.

NOTE

    However, it's also sensible in a corporate environment for standards to dictate which languages a developer may use, limiting the choices in order to ensure maintainability.

The other main requirement for coding standards in a .NET environment is making it easier to convert existing applications (typically written in Visual Basic 5 or 6) to the .NET environment. This is no easy task, as Visual Basic .NET is very different from its predecessors. However, there are some measures that VB coders can take in their existing code to make the transition less painful; for example, explicitly declaring parameters as ByRef or ByVal, and explicitly specifying default properties of objects.

NOTE

Fortunately, tools are available to help you with the process of conversion. For example, VB Law applies automatic coding standards to the code and checks the code for Visual Basic .NET compatibility. Visual Basic Code Advisor offers similar facilities, but checks against Microsoft's own best practices rather than your coding standards. Microsoft also provides a guide for porting ASP to ASP.NET.


To read the entire article from which this tip comes, click over to InformIT. No registration, no muss, no fuss; just good info.


Dig Deeper on Win Development Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close