r/functionalprogramming • u/Jiruze • Mar 01 '24
Question Functional in OOP code base
Is it practical to write functional code inside a highly OOP code base?
I'm tired of searching through every instance of a state variable to analyse the impact. OOP often hides the data flow behind procedures, which took me some additional time to understand a piece of code. I wonder if I could at least try to change how it written so it easier to understand and debug?
11
Upvotes
View all comments
Show parent comment
1
u/unqualified_redditor Mar 05 '24
Functional means leveraging functions as a basic unit of abstraction for designing programs.
Absence of side effects is not at all a requirement and in fact would make your programs useless. Pure functional languages like Haskell and friends don't prevent side effects, they let you track and isolate effectful from non-effectful code.