andrea aplaya wrote:Hello Alexander,
Are there certain kinds of applications/systems where it is better to use a functional design/architecture rather than OO design/architecture, and vice versa?
Thanks!
Regards,
Andrea
Hi Andrea!
Yes, there are definite niches in which either OOP or FP works better.
FP:
- Compilers, research, math
- Multithreaded and concurrent applications (if we want a better story with concurrency bugs)
- Data transformations and pipelines (for example, spam filters)
- Very complicated domains. (FP simplifies domain modeling very much)
- Stateless services
- Correctness (statically typed FP works extremely well for such domains as payments, bank software, blockchains etc)
OOP:
- All the traditional uses of OOP
- GUI (for now, FP doesn't work here that well)
- Business software (at least until we find a good way for FP)
- OOP can even work for soft-realtime apps. I wouldn't try FP there.
I believe I missed a lot here. My personal choice is FP. I had too much time spent in OOP, and don't really want to come back to it