- 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.
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- 實戰低代碼
- Mastering Unity Shaders and Effects
- SQL基礎教程(視頻教學版)
- Go并發編程實戰
- 青少年信息學競賽
- RSpec Essentials
- Mobile Device Exploitation Cookbook
- Creating Data Stories with Tableau Public
- C++ Fundamentals
- 代替VBA!用Python輕松實現Excel編程
- C編程技巧:117個問題解決方案示例
- Hacking Android
- 透視C#核心技術:系統架構及移動端開發
- Socket.IO Cookbook