next up previous contents index
Next: Defining subroutines Up: Physics 2101 - Scientific Previous: Complex data structures   Contents   Index

Subroutines, functions, and modules

As one starts to tackle larger problems, one finds that often there are common tasks that get performed over and over again, and so the code to do these tasks gets repeated over and over again. This can make programs long, and also harder to maintain - if one wanted to change slightly one aspect of a particular task, this might entail many changes throughout you program. In such cases the use of a subroutine or a function can help immensely.

Subsections