- Mastering Immutable.js
- Adam Boduch
- 237字
- 2021-07-08 10:29:59
Preface
I like functional programming languages. One of my favorite features is native immutability. Some functional languages, by default, don't let you change values. What's amazing about this capability is that you can't accidentally break your application by mutating data at the wrong time. If you try, the code won't even compile.
I also dislike certain aspects of functional programming languages. On one hand, it's great that immutability is enforced the way it is. On the other hand, there are times when I just need to push aside my functional programming principles and get the job done.
The JavaScript language has many useful functional programming features out of the box. You don't need a library to compose higher-order functions, for example. Something that's difficult to get right with JavaScript is immutability. This is where Immutable.js shines.
When I first heard about Immutable.js, I pictured a library that enforced immutability on JavaScript structures and nothing more. It turns out there's much more. When you're working with immutable structures, you're constantly creating them. The Immutable.js collection API helps you create the structures you need, when you need them.
Since this is a JavaScript library, there's no immutability by default. This allows me to use Immutable.js where immutability matters, and to mutate things when I need to. This is what makes this such an essential library for applications in the real world; pragmatic functional programming that gets the job done.
- Rust編程:入門、實戰(zhàn)與進階
- Windows Server 2012 Unified Remote Access Planning and Deployment
- Linux操作系統(tǒng)基礎(chǔ)案例教程
- Python時間序列預(yù)測
- Visual FoxPro程序設(shè)計習題集及實驗指導(dǎo)(第四版)
- Lighttpd源碼分析
- Mastering Linux Security and Hardening
- C專家編程
- Python面試通關(guān)寶典
- 青少年P(guān)ython趣味編程
- Practical Responsive Typography
- 計算機應(yīng)用基礎(chǔ)
- R High Performance Programming
- 微信公眾平臺服務(wù)號開發(fā):揭秘九大高級接口
- 像程序員一樣使用MySQL