3 ms·
In my career I started off with OO/imperative, then got heavily into functional programming. I came out at the other end strongly preferring immutable objects o
by HumanDrivenDev 8y ago
In my career I started off with OO/imperative, then got heavily into functional programming. I came out at the other end strongly preferring immutable objects over struct+procedure function programming. It's a style I consider deeply OO, and still has referential transparency, but which usually gets ignored in these discussions.
- arwhatever 8y agoMay I ask for what reason? My guess: encapsulation and/or data hiding? That's the biggest thing I miss when doing FP.
- HumanDrivenDev 8y agoI find it to be cleaner than having module M with struct t and functions M.create: () -> t, M.doStuff: t -> 'a. Which is what tends to happen. It just looks like immutable objects for slow learners...