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

〈Long Names Are Long〉 #24

Open
mht opened this issue Aug 1, 2016 · 1 comment
Open

〈Long Names Are Long〉 #24

mht opened this issue Aug 1, 2016 · 1 comment
Labels

Comments

@mht
Copy link
Collaborator

mht commented Aug 1, 2016

《�Game Programming Patterns》 作者的這篇文章提供一些實用觀點,讓你的程式碼較「難」出現讓人看了不怎麼舒服自己卻很 HIGH 的類別/函數/變數名稱

其中一個例子是類別名稱(範例碼用的是 Dart 語言),例:

class WaffleObject;

作者這麼說:

Obviously it’s an object. Everything is an object. That’s kind of what “object-oriented” means (#4)

所以可將 WaffleObject 進一步縮成:

class Waffle;

「命名」是藝術,是專業。雖說個人喜好不同,但有一點我真心希望大家能一致同意,那就是「不要使用匈牙利命名法」。

@mht mht added the opensource label Aug 1, 2016
@mht mht changed the title 〈Long Names Are Long〉 〈Long Names Are Long〉 Aug 1, 2016
@mht mht added 參考 and removed opensource labels Aug 2, 2016
@mht
Copy link
Collaborator Author

mht commented Aug 14, 2016

免費且開源的錄音與後製工具 Ardour 的 Coding Style 頗龜毛,其中與命名相關的有:

15. Class types have names like `SomeClassType`; variables have names like `a_pleasant_name`.
24. Don't even think of using Microsoft-style "Hungarian" notation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant