IvanCodin Posted February 25, 2008 Share Posted February 25, 2008 I am new to programming and often struggle with call flows in scripts. The question I have is this .... Is it good programming practice for a function to call another function or should this be avoided. I always get stuck when trying to figure out the flow of script errors. I do understand functions run and return results or do specified things. What I struggle with is when I want to check the users input should I do it in the function or test all of the inputs after they have been entered by the user. What is you learned opinions??? Thanks CC Link to comment Share on other sites More sharing options...
botanic Posted February 25, 2008 Share Posted February 25, 2008 Really only a function is useful if you will call it more then once Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 25, 2008 Share Posted February 25, 2008 I am new to programming and often struggle with call flows in scripts. The question I have is this ....Is it good programming practice for a function to call another function or should this be avoided. I always get stuck when trying to figure out the flow of script errors. I do understand functions run and return results or do specified things. What I struggle with is when I want to check the users input should I do it in the function or test all of the inputs after they have been entered by the user.What is you learned opinions???ThanksCCNo learned opinion here, but functions calling other functions is normal and healthy in a well-coded script. As for your specific example, if you only have to code the check once in a particular function, there is no reason to break it out into a separate function. As soon as you find yourself typing the same check in again anywhere else, it's time to put it in a function of its own. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now