Welcome to AddressOf.com Sign in | Help

VB.NET Coding Guidelines

After receiving input from several individuals, I've decided to publish the VB.NET Coding Guidelines.  I'm not a big fan of coding “standards”, but do subscribe to the idea of trying to keep a little consistency in your coding practices.  I'm not going to say that I'm the one-stop answer on the subject; however, I will say that this is a subject that I've spoken with many developers and have done a lot of thinking upon.  I think we all should follow the Design Guidelines for Class Library Developers.  However, these guidelines do not cover language specific details and this is where I hope this document will serve to extend and enhance the design guidelines specifically for VB.NET.

Although I mentioned that I have spoken with many developers on this subject, I should point out that this document was not created in a vacuum.  In many cases, some of the guidelines are causing me to have to change several of my coding habits.  Some of the information has been gathered by discussing with members of the VB.NET team while the original structure of the document is based on Brad Abrams C# Coding Guidelines which is used internally at Microsoft.

Now, before some people look at this document and scream bloody murder, I need to point out the direction I'm approaching this.  First, the design guidelines take priority.  Second, I'm looking at the VB.NET language itself, the code designers code generation and the “pretty print“ feature within Visual Studio .NET.  From there, adding guidelines from my own experience and the experience of others.  During this process, I've been able to find out some of the guidelines that the Visual Basic .NET runtime team follow.  Many of these have been incorporated as well.

Is this document the end all be all for coding guidelines in VB.NET?  Probably not.  My opinion on coding guidelines is that the document should be as concise as possible, allowing for the whole thing to be absorbed and thus be useful.  If the guidelines are too massive or too constricting, they probably will be ignored.  Again, these are simply guidelines and should be treated as such.

I would also like to say, as I do with everything else I make available, that I'm looking to improve on this document.  Without community buy in, this sort of document may not be as widely accepted as I would hope that it could be.  So please feel free to leave comments.

Take me to the VB.NET Coding Guidelines.

[update] Thanks to Marko for suggesting that the link to the guidelines be made available at the top of this post instead of just at the bottom.  I've made the first mention of the guidelines document a link as well.

Published Thursday, March 17, 2005 4:17 AM by CorySmith
Filed under: , ,

Comments

# VB Coding Guidelines (by yag)

Friday, March 18, 2005 4:16 PM by VS Data Team's WebLog

# re: VB.NET Coding Guidelines

Monday, March 21, 2005 12:02 PM by Scott Dockendorf
Congrats on being Larkware'd...

http://www.larkware.com/dg2/TheDailyGrind582.html

# re: VB.NET Coding Guidelines

Tuesday, March 22, 2005 5:41 PM by vijay
we use data grid in .net as combobox

# re: VB.NET Coding Guidelines

Tuesday, March 22, 2005 5:42 PM by vijay
we use datagrid as combobox

# re: VB.NET Coding Guidelines

Wednesday, March 23, 2005 7:23 AM by Gautam
Sir\madam,

I have retrieved the "workendtime" fields data from onetable and i have put it in the combobox. Now in the combobox one by one time is present. And i want to add all the times and display total working hours of a particulaer employee.

please mail to me with source code.

bye.

# re: VB.NET Coding Guidelines

Tuesday, March 29, 2005 12:04 PM by kamitrust
could you kindly send a copy of coding guidelines? Many thanks in advance! john

# re: VB.NET Coding Guidelines

Tuesday, April 05, 2005 9:10 AM by amit
i am a software eng in nic

# re: VB.NET Coding Guidelines

Thursday, June 09, 2005 7:47 AM by yatin
send me coding of how to create connection with sql server and how to fill data adpter from database???

# re: VB.NET Coding Guidelines

Monday, August 28, 2006 4:37 AM by Shankar
dim sqlConn as SqlConnection
dim sqlAdapater as SqlDataAdapter
dim sqlCmd as SqlCommand
dim sqlCbd as SqlCommandBuilder
dim objDset as DataSet

public sub FillData()
sqlConn = new SqlConnection
sqlAdapter = new SqlDataAdapter
sqlCmd = new SqlCommand
sqlCbd = new SqlCommandBuilder
objDset = new DataSet
sqlConn.ConnectionString = "provider=sqloledb.1;user id=sa;password=;data source=shankar;initilia catelog=MyDB"
sqlConn.Open
sqlCmd = "Select * from MyTable"
sqlCmd.Connection = sqlConn
sqlAdapter.SelectCommand = sqlCmd
sqlCbd.Adapter = sqlAdapter
objDset.clear()
sqlAdapter.Fill (objDset, "MyTable")
end sub

# re: VB.NET Coding Guidelines

Tuesday, September 19, 2006 12:55 PM by mahes
Please give the document about Vb.NET
Anonymous comments are disabled