官术网_书友最值得收藏!

Immutability - It's Important

So, we are in the third chapter of, Functional Kotlin. In this chapter, we are going to discuss immutability. Immutability is probably the most important aspect of functional programming; actually, not only in functional programming, but OOP also gives some room to nurture immutability with immutable objects. So, why is it so important? What does it mean? How can we implement immutability in Kotlin? Let's answer these questions in this chapter.

The following are the points we are going to cover in this chapter:

  • What is immutability?
  • The advantages of immutability
  • How to implement immutability in Kotlin?
  • Immutability in variables
  • val versus var
  • val and const val—are they truly immutable?
  • Compiler optimization
  • Immutable collections
  • The disadvantages of immutability
主站蜘蛛池模板: 洪湖市| 甘孜| 普宁市| 南宁市| 泰顺县| 江永县| 泽库县| 云林县| 安福县| 鸡西市| 濮阳县| 五河县| 兰溪市| 泌阳县| 三江| 温州市| 三门县| 荆门市| 兴城市| 报价| 苍南县| 句容市| 奈曼旗| 化德县| 大姚县| 北海市| 南昌市| 朔州市| 温宿县| 雷波县| 青阳县| 土默特右旗| 奈曼旗| 县级市| 杨浦区| 新乐市| 景宁| 富宁县| 临湘市| 新营市| 固始县|