Question

You always hear programming languages advertised as multi-paradigm. I think I understand what this means, but I was wondering if there are any languages that are strictly single paradigm.

From what I understand, the four main paradigms are functional, imperative, logic, and object oriented.

Of course there are others too. Wikipedia uses the following list: Concurrent, Constraints, Dataflow, Declarative, Distributed, Functional, Metaprogramming, Generic, Imperative, Logic, Reflection, Object Oriented, Pipelines, Visual, and Rule-Based.

Or am I missing the point of what a paradigm is completely?

Was it helpful?

Solution

The problem with defining any language as "strictly single paradigm" is that by the virtue of Turing completeness, you can theoretically create languages with paradigms different than the language that created them.

Example: C has no objects, so it would be very hard to say that C follows an object-oriented paradigm yet I can write an object-oriented language in C.

Many languages try very hard to be strictly single paradigm (See: Haskell for a functional example, Javascript for object-oriented), but when it's all said and done, a programming paradigm is a way of thinking rather than an inherit feature of a language. Python is the best example in my mind of a language that can interchangably be considered function or object-oriented or imperative depending on the style of the person that wrote it.

That said, even though it satisfies a deep form of intellectual curiosity, it usually does not behove you do mix paradigms within code for the simple sake of readability and maintainability. There are, of course, plenty of exceptions, but trying to stay in the same paradigmatic way of thinking about your code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top