Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能不能用books代表書本數量? #15

Closed
twy30 opened this issue Jul 10, 2020 · 0 comments · Fixed by #60
Closed

能不能用books代表書本數量? #15

twy30 opened this issue Jul 10, 2020 · 0 comments · Fixed by #60
Assignees

Comments

@twy30
Copy link
Contributor

twy30 commented Jul 10, 2020

https://www.facebook.com/media/set/?set=a.2586039114979737&type=3&comment_id=2586318228285159

請問能不能用books代表書本數量呢??

我會從 語意 及 實務 兩個角度來看:


語意

"numberOfBooks" 或 "bookQuantity" 會比 "books" 更接近『書本數量』,也更不需要依賴上下文來解讀。
因為 "books" 在語意上來說比較接近「書的集合(collection)」;例如,一個「書的物件」的陣列(array),就適合以 "books" 來命名。
所以,如果是我,我會選「不使用 books 來代表書本數量,而是用 numberOfBooks 或 bookQuantity 」。


實務

語言是溝通工具,是人(程式設計師)與機器的溝通工具,也是人(一開始的開發者)與人(後來的維護者)的溝通工具。
如果身處的環境、團隊文化已經有既存的語言習慣 (方言) ,我會使用團隊習慣的方言,優先確保團隊運行順利。

@twy30 twy30 self-assigned this Sep 11, 2020
@twy30 twy30 linked a pull request Sep 11, 2020 that will close this issue
@twy30 twy30 closed this as completed in #60 Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant