Welcome Guest, Not a member yet? Register   Sign In
Script continues to run after loading a view.
#5

[eluser]John_Betong[/eluser]
[quote author="noctrum" date="1263414174"][quote author="Colin Williams" date="1263369751"]It's better for functions to have only one exit point.[/quote]

That's a fairly subjective statement...[/quote]

That is what I learnt and I really think that it makes programming that much simpler.

Quote:Manage the Flow of Your Code

Use only one return statement in any function. Limit your use of break statements to the inside of switch statements. In C, do not use continue statements and limit your use of goto statements to exit conditions that branch to the end of a function. Handle error conditions in C++ with a try/catch block and in C with a goto statement that transfers control to the end of the function so that your functions have only one exit point.

In other words, control the flow of your functions so that each block has one entry point and one exit point. This "one way in, one way out" rule makes code easier to read and debug.




.


Messages In This Thread
Script continues to run after loading a view. - by El Forum - 01-12-2010, 07:01 PM
Script continues to run after loading a view. - by El Forum - 01-12-2010, 07:15 PM
Script continues to run after loading a view. - by El Forum - 01-12-2010, 08:02 PM
Script continues to run after loading a view. - by El Forum - 01-13-2010, 08:22 AM
Script continues to run after loading a view. - by El Forum - 01-13-2010, 08:41 AM
Script continues to run after loading a view. - by El Forum - 01-13-2010, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB