Article 129 - Programming - Function vs Routine

In modern programming languages, the notation of a function and routine is often used interchangably. However, an expert should always understand the full differences of each type.

Defintion

A routine is simply a function without a return value.

Examples

For example, a void in the return section of a method in Java is an example of a routine, except we still call it a method.

The following is an example of a routine.

void aRoutine(){
    return;
}

The following is an example of a function.

int aFunction(){
    return 1;
}

Comments (0)

Post a comment

  • Name:
  • Post:
  • Challenge:

Register or login to post comments easier.


Vantasy World Copyright 2011 - 2017. Vantasy World is a project developed by Vantasy Online. Privacy Policy.