Click to See Complete Forum and Search --> : VB Standards and Guidlines
DeadEyes
Jul 2nd, 2004, 07:47 AM
I came across this pdf Visual Basic™ 32-bit Application Development
Standards and Guidelines
and thought it might be useful for newbies (and maybe even some more experienced people)
It's not stricly a "code it better make it more efficient" but it will help people adopt best practice for writing their code.
I hope people find it useful.
szlamany
Jul 2nd, 2004, 01:13 PM
The stuff on SQL in 13.2 is great.
I wonder how many people live by 13.2.1.21...
13.2.1.21. Use forward-only/read-only recordsets. To update data, use SQL
INSERT and UPDATE statements.
we do :)
and all through SPROCS :D
Dave Sell
Jul 27th, 2004, 04:01 PM
I wonder how many people use 5.2.9 Use of An Object's Default Property
It states you should explicitly use the specific property and essentially never use default properties. I agree 100%.
DeadEyes
Jul 28th, 2004, 05:44 AM
Originally posted by Dave Sell
I wonder how many people use 5.2.9 Use of An Object's Default Property
It states you should explicitly use the specific property and essentially never use default properties. I agree 100%.
yeah it's really annoying maintaing other peoples code when they use default properties.
Dave Sell
Jul 28th, 2004, 03:38 PM
I might have found my favorite:
6.2.1 Keep It Short
In general, routines should not be longer than one screen page. Routines longer than one screen should be broken down into subroutines.
If only everyone strove to this ideal...
szlamany
Jul 28th, 2004, 03:42 PM
I agree with that one completely...
Unfortunately, I think that people feel that GOSUB is evil, like GOTO.
I use GOSUB/RETURN subroutines all the time. They are fine.
Making an actual SUB or FUNCTION might be cleaner in some peoples minds, but all that stack framing for function calls is a true waste...
Dave Sell
Jul 28th, 2004, 03:50 PM
I was not implying that one should use GOTOs or GOSUBs at all. In fact I never use them.
I don't think that if you are using VB you have to be all that worried about sacrificing such small speed/resources in order to code in a way that is human-freindly.
IMHO, if you are that freaked out about wasting speed/resources you might consider moving development to C++.
I do not go overboard with Functions/Subs either though. I like to stick to the above rule to keep every Function/Sub to about a screen-length, but it never happens ALL the time.
For example, I wrote a reporting tool in VB that took 40 hours to run from start to finish. I re-arranged alot of logic to account for the true speed/resource hog (which was my Excel object) and cut my time down to 20 minutes.
Could I cut it down further by using GOSUBs? I don't know I spose I could knock off another minute or 2 but what's the frigging point? Catch my drift?
tanmoymoitra
Jul 29th, 2004, 12:59 AM
Hi Guys,
Is there any Guidelines for Vb.NEt coding.
PLease let me know if yes.
Tanmoy
shunt
Aug 10th, 2004, 09:53 AM
Hi guys,
I dont agree with many of the points layed out in this standards doc. But that does not really matter...
The thing that makes it good is that it is a standard which, if followed exactly, will result in easy reading/easy maintainable code.
I think it should be up to the project lead to stipulate what standard the application will be developed against. And then, all should follow those standards for the project.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.