OOP and FP Compatibility

This cluster discusses the relationship between object-oriented programming (OOP) and functional programming (FP), debating whether they are orthogonal, mutually exclusive, or can be effectively combined in languages like Scala and OCaml.

📉 Falling 0.4x Programming Languages
4,903
Comments
20
Years Active
5
Top Authors
#7183
Topic ID

Activity Over Time

2007
12
2008
53
2009
108
2010
119
2011
158
2012
243
2013
262
2014
368
2015
241
2016
329
2017
362
2018
244
2019
472
2020
447
2021
358
2022
321
2023
317
2024
236
2025
242
2026
11

Keywords

OO destroyallsoftware.com TypeScript IMO stick.hit ML drum.play ADT OOP DDD oop functional fp oo functional programming programming polymorphism object oriented functions oriented

Sample Comments

rs86 Nov 27, 2018 View on HN

FP and OOP are orthogonal... You can have purely functional objects

colordrops Apr 27, 2020 View on HN

OOP and functional programming aren't mutually exclusive.

cbeach Feb 12, 2023 View on HN

Why would OOP and functional programming be at opposite ends of a spectrum?

waynecochran Feb 11, 2022 View on HN

OOP and functional programming are orthogonal -- you can do both ...

depressed Apr 5, 2019 View on HN

If functional programming were implemented as widely and abused as much as OOP is, would it really fare any better?

BozeWolf Oct 7, 2014 View on HN

Functional has not much to do with object oriented. Scala for example is both functional and OO. I think you mean the competition between imperative and functional languages.

nerdy Sep 4, 2015 View on HN

I reject the idea that this is an OO problem. These same problems would exist in the form of functional programming, except it would be "functions" instead of "methods"

ErotemeObelus Oct 25, 2019 View on HN

No. Object-oriented programming is not about syntax but rather is a generalization of functional programming. Functions are objects too: they have a domain and codomain as fields and implement the return ane call methods.

ruszki Jan 6, 2026 View on HN

Is it possible to have an OOP language which is also functional? Or is it impossible without imperative paradigms?

dnautics Jun 5, 2020 View on HN

no it's not, because a key part of OO is encapsulation. You really do need a functional language with naked, fully introspectable types everywhere, for this to work effectively.