- Hands-On Data Structures and Algorithms with Rust
- Claus Matzinger
- 128字
- 2021-07-02 14:11:42
Immutable variables
Rust—like many functional languages—embraces immutable variables. They are the default, and changing mutability requires explicit declaration with mut, which tells the compiler what the variable is going to be used for (reading or writing).
Functional programming languages are known for facilitating the ability to work concurrently, thanks to immutability guarantees; reading data does not produce side effects! Requiring explicit mutability gives the compiler a chance to check where and if mutability is required, and therefore whether a data race may occur.
This results in compile-time warnings and errors instead of crashes and strange race conditions at runtime, something that many production users appreciate. In short, it's easier to think through your code if mutability is a (rare) option instead of the norm.
- 企業數字化創新引擎:企業級PaaS平臺HZERO
- Hadoop與大數據挖掘(第2版)
- 醫療大數據挖掘與可視化
- UDK iOS Game Development Beginner's Guide
- 大數據技術入門
- 深入淺出 Hyperscan:高性能正則表達式算法原理與設計
- AI時代的數據價值創造:從數據底座到大模型應用落地
- Flutter Projects
- 淘寶、天貓電商數據分析與挖掘實戰(第2版)
- 大數據數學基礎(Python語言描述)
- SIEMENS數控技術應用工程師:SINUMERIK 840D-810D數控系統功能應用與維修調整教程
- MySQL數據庫實用教程
- 中國云存儲發展報告
- Cognitive Computing with IBM Watson
- Unity for Architectural Visualization