Skip to main content

All Questions

5 votes
3 answers
707 views

How could a computer program do anything if everything is immutable?

I feel this is a bad question because I probably do not understand what I am talking about. In my effort to learn about functional programming, I became stumped on understanding the idea of immutable ...
Julian's user avatar
  • 77
38 votes
7 answers
9k views

Do you need to think about encapsulation if you can ensure immutability?

Encapsulation In object-oriented programming (OOP), encapsulation refers to the bundling of data with the methods that operate on that data, or the restricting of direct access to some of an ...
Christopher Trotter's user avatar
7 votes
2 answers
1k views

Encapsulating moving parts in OO vs Minimizing moving parts in FP

I am from OO background just started learning FP paradigm. Came across quote by Michael Feathers - "OO makes code understandable by encapsulating moving parts. FP makes code understandable by ...
rahulaga-msft's user avatar
9 votes
7 answers
4k views

what can go wrong in context of functional programming if my object is mutable?

I can see the benefits of mutable vs immutable objects like immutable objects take away lot of hard to troubleshoot issues in multi threaded programming due to shared and writeable state. On the ...
rahulaga-msft's user avatar
3 votes
1 answer
239 views

Making mutable classes immutable

When trying to turn a class with mutable state into an immutable one I am regularly having a hard time choosing between two alternatives: I can 1) either extract the state into another (immutable) ...
lex82's user avatar
  • 161
12 votes
2 answers
3k views

Can we really use immutability in OOP without losing all key OOP features?

I see the benefits of making objects in my program immutable. When I am really deeply thinking about a good design for my application I often naturally arrive at many of my objects being immutable. It ...
lishaak's user avatar
  • 467
53 votes
2 answers
9k views

What did Alan Kay mean by "assignment" in The Early History of Smalltalk?

I have been reading The Early History of Smalltalk and there are a few mentions of "assignment" which make me question my understanding of its meaning: Though OOP came from many motivations, two ...
Olivier Dagenais's user avatar