Results 1 to 9 of 9

Thread: VB Standards and Guidlines

  1. #1

    Thread Starter
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    VB Standards and Guidlines

    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.
    Attached Files Attached Files

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    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

  3. #3
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    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%.

  4. #4

    Thread Starter
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    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.

  5. #5
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    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...

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    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...

  7. #7
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    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?

  8. #8
    New Member
    Join Date
    Jul 2004
    Posts
    9
    Hi Guys,

    Is there any Guidelines for Vb.NEt coding.
    PLease let me know if yes.



    Tanmoy

  9. #9
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width