Results 1 to 2 of 2

Thread: [RESOLVED] [2005] # of nested program control statements - Rule of Thumb?

  1. #1

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Resolved [RESOLVED] [2005] # of nested program control statements - Rule of Thumb?

    Hi all,

    I'm asking because I recently download some sample code from somewhere where there were so many nested statements that a lot of the code was running off the right side of the screen.

    I'm guessing there may be some times where you need a number of nested statements but is there some sort of rule of thumb: I have # many nested control statements so I should probably rethink my code because that is too many?

    Thanks for any insight.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] # of nested program control statements - Rule of Thumb?

    You should always write code that is as readable as possible without compromising performance. If the indenting of nested blocks is making your code less readable then you should consider alternatives, like moving the contents of some blocks to their own methods.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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