4 ms·
Functional vs OOP isn't really about the type system - Clojure is a functional language and it's dynamically typed. The main value of functional programming is
by moonchrome 12y ago
Functional vs OOP isn't really about the type system - Clojure is a functional language and it's dynamically typed.
The main value of functional programming is working with values and isolating mutation. When you deal with just immutable values your code maps to distributed systems naturally which is why functional programming is becoming more popular with the advent of cloud and distributed computing.
- pjmlp 12y agoAnd it supports CLOS like OOP!
- seanmcdirmid 12y ago> When you deal with just immutable values your code maps to distributed systems naturally which is why functional programming is becoming more popular with the advent of cloud and distributed computing. I work with hardcore distributed systems people (the ones that attend SOSP and OSDI). And the penetration of functional programming in distributed systems is about 0%. Sure, immutable state is easy to not share, but sharing of mutable state is inevitable, and you gotta deal with it, not try to wish it away. The only people who seem to think functional programming is great for distributed systems seems to be people who don't really do distributed systems, or at least ones where scalability, performance, and fault tolerance are critical.
- judk 12y agoShared mutable state tends to be only in a core data store or scheduler/thread manager, a small part of a distributed system.
- seanmcdirmid 12y agoYa...no. Maybe toy distributed systems, but not the larger ones industry works with. Let's put it this way: if you have no shared distributed mutable state to worry about, it's not really a distributed system, it's probably doing parallel computation or something similar (like via map reduce).