Reason(原因)
It is easier to reason about constants than about variables. Something immutable cannot change unexpectedly. Sometimes immutability enables better optimization. You can't have a data race on a constant.
常量比变量更好理解。不变的东西不会被意外修改。有时,不变性会带来更好的优化。常量是不会发生数据竞争的。
See(参考)
Con: Constants and immutability
Con:常量和不变性
觉得本文有帮助,欢迎点赞并分享给更多的朋友!
阅读更多更新文章,请关注微信公众号【面向对象思考】
















