Modularity is all about breaking a software project down into clearly identifiable program components. The generic name given to such components is subroutines (or subprograms). They are the building blocks of software. Subroutines can generally be classified in most languages as either a Procedure or a Function.
Procedures
Procedures are named blocks of code used to group together a related sequence of commands or tasks into a single component. The Procedure can cause an effect or preform an operation.
Functions
A function returns one or more values which can be assigned to variables when the function is called.