见名知意
写代码时,除了要有良好的代码逻辑之外,其中很重要的一点是:在给变量、函数等命名时保证见名知意,这样才能:
- 看到(变量,函数等)的(代码)名字,就能理解其含义
- 看到代码,就能知道其作用
见名知意==自描述性==Expressive
之前看到过swift语言的介绍,其中就有Expressive的解释:Swift.org - About Swift
Expressive. Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. But Swift is never done. We will monitor language advancements and embrace what works, continually evolving to make Swift even better.
即:语言有自描述性,就很好用。
所以个人也感觉swift
也是属于好用的编程语言之一
注: 另外一个觉得好用的是Python