Monday, February 18, 2019

Procedures, Parameters & Sub-programs :: essays research papers

Procedures, Parameters & Sub-ProgramsIn either modern programme language, procedures play a vital role in theconstruction of any new parcel. These days, procedures ar used instead ofthe old constructs of GOTO and GOSUB, which have since render obsolete.Procedures provide a way out of important features for the modern softw atomic number 18 machinate-Programs are easier to write. Procedures save a enlarged amount of time duringsoftware development as the programmer only needs to polity a procedure once, butcan use it a number of times. Procedures are especi bothy useful in recursivealgorithms where the same piece of principle has to be executed over and over again.The use of procedures allows a large and complex program to be broken up into anumber of untold smaller parts, each accomplished by a procedure. Procedures alikeprovide a form of abstraction as all the programmer has to do is know how tocall a procedure and what it does, not how it accomplishes the task.Program s are easier to read. Procedures help to make programs shorter, and thuseasier to read, by replacing longsighted sequences of statements with unrivalled childlyprocedure call. By choosing goo procedure label, even the names of theprocedures help to document the program and make it easier to understand.Programs are easier to modify. When repeated actions are replaced by oneprocedure call, it becomes much easier to modify the code at a later stage, andalso correct any errors. By make up the program in a modular fashion viaprocedures it becomes much easier to update and replace sections of the programat a later date, if all the code for the specific section is in a particularmodule.Programs regard less time to compile. Replacing a sequence of statements withonce simple procedure call usually reduces the compilation time of the program,so long as the program contains more than one reference to the procedure object programs require less memory. Procedures reduce the memory consumpt ionof the program in two ways. Firstly they reduce code duplication as the codeonly needs to be stored once, but the procedure can be called many times.Secondly, procedures allow more efficient storage of data, because storage for aprocedures variables is allocated when the procedure is called and deallocatedwhen it returns.We can divide procedures into two groups-Function procedures, are procedures which rate a single value and whose callsappear in expressionsFor example, the procedure ABS is a function procedure, when given a number x,ABS computes the absolute value of x a call of ABS appears in an expression,

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.