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

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
主站蜘蛛池模板: 盱眙县| 肇庆市| 重庆市| 太谷县| 北辰区| 赤峰市| 贡嘎县| 舒城县| 延安市| 监利县| 靖边县| 鸡西市| 上饶市| 门头沟区| 白玉县| 许昌县| 蒙山县| 漯河市| 翁源县| 宕昌县| 尉氏县| 玉溪市| 深泽县| 建湖县| 南京市| 罗甸县| 循化| 西宁市| 华阴市| 斗六市| 湟源县| 临泽县| 丹棱县| 湛江市| 呼玛县| 哈巴河县| 洱源县| 新泰市| 沙田区| 马尔康县| 临安市|