4 ms·
I think there's a false dichotomy which pervades discussion of programming "paradigms". They're all tools with specific jobs, and a good programmer will be a ma
by codemonkey-zeta 6y ago
I think there's a false dichotomy which pervades discussion of programming "paradigms". They're all tools with specific jobs, and a good programmer will be a master of many.
OOP is a tool designed for a certain class of problems - problems which are adequately modeled by message-passing entities. A desktop environment is the perfect example.
FP is a tool well-suited to other problems. If I wanted a system to manage facts about some domain, and change those facts based on outside stimuli, I would be inclined towards a purely functional system operating on immutable data structures. Think about the proliferation of redux in web development and you'll see this is exactly the model of user interaction with a single-page web application.
If I wanted a system that closely interacted with a number of chips/hardware components with extremely fine-grained control, I would use an imperative approach.
All these paradigms have their purpose. It's when programmers get dogmatic about a certain paradigm where insane levels of complexity arise. Know your tools, and use them appropriately.
- softwaredoug 6y agoAlso a bit of a false dichotomy with a strict mapping of programming languages and paradigms. OOP can happen in C, though the language's affordances aren't great for it. Same with functional programming in Java... Some languages have OK affordances for all of the above, but not great for any one.