Imperative languages

Cards (3)

  • In this paradigm, programmers will solve a problem by writing a set of instructions that state how a problem should be solved. Both the terms imperative and procedural are used to describe this subset of languages, but procedural specifically describes a language used to write programs that can be split into procedures (or subroutines). For example, BASIC is a procedural language.
  • One big advantage of high-level languages over low-level languages is that they have built-in functions for programmers to use. For example in Python, using the built-in function print makes the Python code output something to the screen. The programmer does not need to know the complexity of how the print statement is executed, just that it will do the job.
  • Similarly, for high-level imperative languages there are libraries of functions that can be imported to solve specific problems. For example in Python, one of the things a programmer can do with the random module (library) is to generate a random number — without needing to know exactly how that random number is generated when the code is executed.