FrankKai / FrankKai.github.io

FE blog
https://frankkai.github.io/
363 stars 39 forks source link

注释那些事儿 #62

Open FrankKai opened 6 years ago

FrankKai commented 6 years ago

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

参考资料: 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 commented 5 years ago

Better Comments推荐的注释写法

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

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

image