Is it good practice to create functions which use other functions that you built?
I was wondering if it was good to have this since it makes code less portable.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Very good practice.
It is called code reuse and this is what programming is all about.
As for your argument about it making “code less portable”, that only makes sense in a very low level language such as assembly, and even then it makes it more portable as you can isolate platform specific code into functions.
Good code is made of small, understandable functions. Some people say that a function that is longer than 30 lines is too long.