Module-based programming language is —
2022
Module-based programming language is —
- A.
C
- B.
C++
- C.
ML
- D.
Ada
Attempted by 376 students.
Show answer & explanation
Correct answer: D
Programming languages are commonly grouped by their organizing paradigm — procedural, object-oriented, functional, logic, and module-based. A module-based language builds programs around the module/package as the core unit: a construct that separates a public interface (specification) from a private implementation (body), enforces encapsulation, and supports separate compilation of units.
Among the given options, Ada is built around exactly this construct — the package. An Ada package splits into a public specification and a private body, hides implementation details behind that interface, and can be compiled separately from the units that use it. This package-centric design is why Ada is the standard textbook example cited for the module-based category.
C has no package/module keyword at all — modularity is only a convention of splitting code into header (.h) and source (.c) files, tied together by the linker, not a language-level construct.
Classical C++ (pre-C++20) still relies on the same header/source-file convention as C; in this paradigm taxonomy C++ is placed under the object-oriented category, not module-based.
ML has a genuine module system — structures, signatures, and functors — but the paradigm taxonomy classifies ML under functional languages, not module-based.
So, of the four options, only Ada is classified as the module-based programming language.
A video solution is available for this question — log in and enroll to watch it.