Programming paradigms are not mutually exclusive classifications. Within the notion of programming paradigms, there are hierarchies and overlaps. Some classifications such as declarative programming might describe a broad set of characteristics and languages while others such as dynamic programming are quite specific.
Some programming languages, such as Haskell, are designed specifically to conform to a single paradigm (in Haskell's case, functional programming). However, because the definitions and boundaries of the paradigms themselves overlap, it's possible to classify a programming language using multiple programming paradigms concurrently.
Let's take Java, for example. Within Java, there are elements of multiple programming paradigms:
- Imperative programming
- Object-oriented programming
- Structural programming
- Procedural programming
- Generic programming
- Event-driven
Some of these are subtypes of others. For example, object-oriented programming can be considered a subtype of structured programming. Some of the paradigms, such as generic and event-driven programming, can be realized within Java, but aren't necessarily core tenets of the language. In general, understanding a language's supported paradigms can help you quickly understand what is supported and possible with a language, independent of any exact language details.
In the next section, we'll discuss imperative programming languages.