|
-
Jul 2nd, 2007, 09:09 PM
#1
Thread Starter
Registered User
[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.
-
Jul 3rd, 2007, 12:57 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|