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

注释那些事儿 #62

Open
FrankKai opened this issue May 18, 2018 · 1 comment
Open

注释那些事儿 #62

FrankKai opened this issue May 18, 2018 · 1 comment
Labels

Comments

@FrankKai
Copy link
Owner

FrankKai commented May 18, 2018

写好代码注释,可以很大程度上增强代码可读性。
所以我将在这个issue记录关于注释的知识和实践。

  • Better Comments推荐的注释写法

参考资料:
https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
https://github.com/fex-team/styleguide/blob/master/javascript.md#24-%E6%B3%A8%E9%87%8A
https://github.com/airbnb/javascript#comments
https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/comments/

@FrankKai FrankKai changed the title Vue踩坑记录 注释那些事儿 Sep 6, 2019
@FrankKai
Copy link
Owner Author

FrankKai commented Sep 6, 2019

Better Comments推荐的注释写法

Better Comments是一款vscode插件,可以使得我们的注释更加human-friendly。
它主要将注释分为以下几类:

  • 普通注释 *
  • 警告 !
  • 查询 ?
  • 待办事项 TODO:
  • 入参 @param

可以通过/** **///两种方式包裹注释。
除此之外,它还包括:已注释代码加横线,高亮注释。

image

@FrankKai FrankKai reopened this Sep 6, 2019
@FrankKai FrankKai added the 随想 label Mar 9, 2020
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