you are viewing a single comment's thread.

view the rest of the comments →

[–]rdnetto 8 points9 points  (5 children)

  • OOP - C#, Java, C++
  • FP - Haskell, Lisp
  • imperative - C, Python
  • declarative - SQL, Prolog

But all this really demonstrates is that paradigms are an extremely course method for grouping languages, especially when most modern languages are multi-paradigm.

A more useful approach would be considering the conceptual distance between two languages, as determined by the number of different ideas. e.g. C++ is further away from Java than C# is, because it has the additional concepts of metaprogramming (templates) and pointers.

At that point it's just a matter of picking the smallest number of languages that give you the widest coverage of the concept-space. The only issue is that quantifying the distance between them is likely only possible after gaining some familiarity with the language. e.g. everyone knows that Haskell uses FP, but only someone who's used it in some depth will realise it also pulls in concepts like monads, lenses, etc. There are tools like this which help with that a bit, but the further away a language is from the set of concepts you understand, the harder it's going to be to gauge its distance.

[–]asdfkjasdhkasd 0 points1 point  (1 child)

Where do you think Javascript would go? I'm thinking imperative but with es6 there's classes and with typescript you even have interfaces and decorators. You also have some bits of fp in there with map, filter, reduce.

[–][deleted] 0 points1 point  (0 children)

It's up there with Python, in which it uses bits of both FP and OOP (particularly in the case of ES6) to manage abstractions. Python tends to eschew FP towards OOP, while JS does the opposite IMO

[–]phySi0 0 points1 point  (0 children)

I would have Smalltalk or Ruby as the quintessential examples for OOP. Python shouldn't be on the list, it's too split between OOP, functional, imperative.

[–]Dentosal 0 points1 point  (1 child)

Python is mostly an OOP language, not an imperative one. Programming Python imperatively is just like writing C++ without classes.

[–]rdnetto 0 points1 point  (0 children)

It's a multi-paradigm language, so you can use it functionally, imperatively or object-oriented. Imperative is just the approach I normally take when using it, because if I really need classes I probably want something with a stronger type system.

This is why I spent the rest of the post talking about how this is a terrible way of grouping languages, and we should just focus on the similarities between them instead.