Monday, May 2, 2011

Modular / function

Modular programming is a programming technique in which programs are usually large enough to be divided into several smaller parts so that the program will be easily understood and can be reused, either for the program itself or other programs that have the same process.-Module in C + + language is known by the name of the function (function)Consists of C-language functions, both directly declared in the program or split in the header file.-Function which always exist in C + + program is the main function

Modular Advantages:-Shorter Courses-Easy to read and understand-Easily documented-Reduce errors and easy to find fault-Errors that occur are "local"
Function  is a set of instructions / commands / programs that are grouped into one, located separately from programs that use these functions, have certain unique name, and used to do a particular purpose.In other programming languages ​​functions can be called as a subroutine (Basic, VB) or procedure (Pascal, Delphi)

Excess function:-Can perform top-down approach and the divide-and conquer:     Top-down: easy search program     Divide-and-conquer: a large program can be split into smaller programs.-Program code becomes shorter, readable, and easily understood-The program can be done by some people so quick program finished with an easy coordination.-Easy to find the mistakes because the flow is clear and simple logic-Mistakes can be localized in a particular module.-Program modifications can be performed on a particular module without disrupting the overall program-Function - the function makes the program has a clear structure.-By separating step - step detail to one or more functions - functions, the main function (main) will be shorter, clearer and easier to understand.-These functions are used to avoid writing the same program written over and over - again.-Step - this step can be written only once in the form of the function separately. Furthermore, the programs that require step - this step is not necessary always to write, not enough to call the function.-Simplify documentation.-Reusability: A function can be reused by other programs or functions

No comments:

Post a Comment