Functions

A function is a block of code that can be defined once and reused any number of times. When writing programs, it is best practice to break up complex programmatic processes into smaller units that perform specific tasks. Doing this has many advantages, some of which are:

  • Improving code readability: It is much easier to read programs that have been broken down into functional units. This is because the scope of the code to be understood at any given point in time is reduced when functions are utilized. The majority of the time, a programmer needs to only write or adjust a section of a large code base. When functions are utilized, the context of the program that needs to be read to ameliorate program logic is restricted to the body of the function in which the logic is written.
  • Improving the maintainability of a code base: The use of functions in a code base makes it easy to maintain programs. If a change needs to be made to a particular program feature, many times it is as easy as adjusting a function in which the feature has been created.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.124.177