【发布时间】:2020-04-11 16:46:45
【问题描述】:
可能看起来很简单,但我很想知道 Doc Comments 和 Dart 中的 Comments 之间的确切区别。
///这是一个文档评论
//这是一个评论
在我看来,在这里提问和回答也可以对其他人有所帮助:)
【问题讨论】:
可能看起来很简单,但我很想知道 Doc Comments 和 Dart 中的 Comments 之间的确切区别。
///这是一个文档评论
//这是一个评论
在我看来,在这里提问和回答也可以对其他人有所帮助:)
【问题讨论】:
评论 (//)
注释通常用于注释掉你的代码的某些部分,或者在你的代码中添加一些cmet,你想和你的队友交流。
文档注释 (///)
文档注释用于文档目的。 dartdoc 解析 doc cmets 并创建文档页面。
+--------------------------------------------+-----------------------------------------------------+
| Comments | Doc Comments |
+--------------------------------------------+-----------------------------------------------------+
| - Comment out some part of your code | - Anything that you want to document using dartdoc |
| - Private APIs | - Usually used for public API/Framework/Library |
| - Private variable declaration | |
| - Method implementation logic | |
| - Something you need to do in future | |
| for improvements or cleanup purpose etc | |
+--------------------------------------------+-----------------------------------------------------+
你可以在Effective Dart - Documentation阅读更多关于这些的信息
【讨论】: