Immutability increases Code Simplicity

Immutability has many advantages, as many functional programming proponents will argue. Just to mention a few, immutable classes are side effect free and are easily testable. I am not going to go into the details of listing all the advantages of immutability in this short article. I will focus mainly on the effects on code simplicity and code comprehension. Recently, I revisited one of my older projects and by examining the code, I found that a class could be immutable, or its objects could be value objects using Domain Driven Development (DDD) terminology....

January 21, 2024 · 7 min · Dimitris Dranidis