Why are User defined Functions used? tccicomputercoaching.com There are 2 types of functions in Programming. Built in and User Defined Function. Built in means already written, tested and stored in one file. User Defined Function user develop, compile and run at a time. Definition: User-defined functions allow the programmer and “user”—to put same code together that performs one “function”. We divide one complex and lengthy task in different modules. So, there are so many advantages.
Advantages of User Defined Function: 1. It would be easy to solve errors module wise. 2. Reuse the code in your function. 3. You get easier to read code, a. Since you don’t mix the what (should be done) with the how (it should be done) everywhere. Instead, you just say what you want by calling your lower level function and that deals with the details of how it must do its work. 4. Decreases the length of the programme. 5. The smaller user defined functions can be more easily tested or replaced by improved versions.