4 ms·
You're conflating paradigms (program design philosophies) with language features (program design tools): (0) Functional programming is a paradigm that encourag
by catnaroek 10y ago
You're conflating paradigms (program design philosophies) with language features (program design tools):
(0) Functional programming is a paradigm that encourages expressing computation as expression evaluation, and discourages relying on more computational effects than are necessary to obtain a desired result.
(1) Object-oriented programming is a paradigm that discourages directly manipulating data structures from different parts of a program. Objects expose operations that act on a data structure hidden from the rest of the program.
(2) Effect segregation is a feature of some programming languages, notably Haskell and its descendants. An effect system classifies computations according to their possible effects, just like a type system classifies computations according to their possible results. You wouldn't call static typing a paradigm, right?
- smallnamespace 10y agoYou're right, effect segregation is not a paradigm per se. The fact still stands that it's closely aligned with the functional programming paradigm, and not OOP. Programing paradigms and language features are closely related: certain features make certain paradigms easier, and paradigms spur the development of particular features.