Q&A: What are the main benefits of using procedures in scripts?

Question by adrian: What are the main benefits of using procedures in scripts?

Best answer:

Answer by Mike H
Encapsulation. Procedures make the script more readable. Instead of seeing the guts of a terribly long and complicated process, you see it as it’s name, which is human-readable, and leaves your mind open to understand how that part of the program fits into the larger scheme.

Code Re-Use: Once you define a procedure for some process, you can always call it by it’s simple name…again, leaving your mind open to keep focused on the portion of the program where that procedure is executed.

Those are the two big ones. They extend beyond just scripts and procedures–they are fundamental aspects of computer programming.

What do you think? Answer below!

Get the book now