- Mastering Immutable.js
- Adam Boduch
- 210字
- 2021-07-08 10:30:03
Deleting old data
When you first learned how to program, one of the earliest concepts that you were taught was the variable. A variable is something that's used to store a value, so of course it's important! When you create a variable and assign its initial value, it feels like you're creating new data. This is because you are creating new data.
Then, later on in your code, you assign a new value to your variable. It's a variable, so naturally it varies. This might also seem like you're creating new data, which you are; if you assign the value 5 to your variable, then that's a new value that didn't exist before. Here's the catch: you're also destroying data. What if your variable had a value of 2 before you assigned it 5?
This might not seem like a big deal. Isn't a variable supposed to store whatever value you assign to it? Yes, variables work perfectly fine that way. They do exactly what we ask them to do. So, the problem isn't strictly that variables can change their values. Rather, it's a human limitation—we can't reason our way through the huge number of variable changes that happen in our code. This leads to some scary bugs.
- Implementing VMware Horizon 7(Second Edition)
- C語言程序設計實踐教程(第2版)
- 解構產品經理:互聯網產品策劃入門寶典
- CMDB分步構建指南
- 大模型RAG實戰:RAG原理、應用與系統構建
- The DevOps 2.5 Toolkit
- Java:High-Performance Apps with Java 9
- 智能手機APP UI設計與應用任務教程
- 深入淺出Python數據分析
- Mastering ASP.NET Web API
- Docker on Windows
- MATLAB計算機視覺實戰
- Python GUI設計tkinter菜鳥編程(增強版)
- Visual Basic.NET程序設計
- C語言解惑:指針、數組、函數和多文件編程