Modular programming is an approach to software development where the individual functions of a program are separated into self-contained components called modules. Each module contains everything necessary to fulfill its own functionality, and can be edited and modified without the entire project being affected. Modular programming is accomplished by maintaining a consistent module interface that other software components use to access each module’s functions.

In some languages, such as Java and Go, a module is known as a “package.” In other languages such as Python, a “package” refers to a collection of modules.

Languages that support modular programming

  • Ada
  • ALGOL
  • COBOL
  • D
  • Dart
  • Erlang
  • F
  • Fortran
  • Go
  • Haskell
  • Java
  • MATLAB
  • ML
  • Modula
  • JavaScript
  • Oberon
  • Objective-C
  • OCaml
  • Turbo Pascal
  • Perl
  • PureBasic
  • Python
  • Ruby

Programming terms