answersLogoWhite

0

Without functions your code has to be written procedurally, which involves using many jump and goto statements to alter the flow of the code. However, having jumped to a new section of code, there is no automatic return path to the caller. The end result is spaghetti code that is difficult to both read and maintain. Functions support the concept of structured procedure calls, allowing programs to branch and return from specific code segments, making it much easier to follow the flow of the program. Functions allow highly complex procedures to be broken down into a series of simple function calls, each of which fulfils a minor but highly specific role within the overall procedure. Functions can also return values to the caller and function parameters and overloads allow the caller to alter the specific behaviour of a function, thus increasing the flexibility of the function, allowing the same function to be re-used and called in a wide variety of ways.

User Avatar

Wiki User

12y ago

What else can I help you with?