Coding style C#-在课堂陈述之前或之后发表评论?

Coding style C#-在课堂陈述之前或之后发表评论?,coding-style,comments,Coding Style,Comments,我最近看到了一个系统,它在注释项之前使用C#注释的一致位置。例如: /// <summary> /// The pool of relative sequence ids used by the model. /// Initially set to {1..Parameters.creditGoal}. Elements /// will be removed and put into the sequence window as credit /// is acquired,

我最近看到了一个系统,它在注释项之前使用C#注释的一致位置。例如:

/// <summary>
/// The pool of relative sequence ids used by the model.
/// Initially set to {1..Parameters.creditGoal}. Elements 
/// will be removed and put into the sequence window as credit
/// is acquired, and put back into the pool when they have been used. 
/// </summary>
static SetContainer<int> sequenceIdPool;
//
///模型使用的相对序列ID池。
///最初设置为{1..Parameters.creditGoal}。元素
///将被删除并作为贷项放入序列窗口
///获得,并在使用后放回池中。
/// 
静态SetContainer sequenceIdPool;

//
///断言具有相关需求描述的需求。
/// 
/// 
/// 
/// 
静态void需要(bool条件、int-id、字符串描述)
{
Condition.IsTrue(Condition,MakeRequirementId(id,description));
}
这似乎很奇怪,也是可读性的障碍。我想不出主题标识符(A-head、B-head等)先于细节的写作风格

因此,我希望看到注释块紧跟在它所描述的项目之后,例如

static void Requires(bool condition, int id, string description)
/// <summary>
/// Asserts a requirement with associated requirement description.
/// </summary>
/// <param name="condition"></param>
/// <param name="id"></param>
/// <param name="description"></param>
{
    Condition.IsTrue(condition, MakeRequirementId(id, description));
}
静态void需要(bool条件、int-id、字符串描述)
/// 
///断言具有相关需求描述的需求。
/// 
/// 
/// 
/// 
{
Condition.IsTrue(Condition,MakeRequirementId(id,description));
}

问:有没有任何技术上的理由支持将评论块放在主题之前

嗯,就我个人而言,我从来没有看到任何评论放在target之后。对我来说,这看起来很奇怪。关于技术原因-例如,Visual Studio IntelliSense无法识别放置在目标之后的注释

static void Requires(bool condition, int id, string description)
/// <summary>
/// Asserts a requirement with associated requirement description.
/// </summary>
/// <param name="condition"></param>
/// <param name="id"></param>
/// <param name="description"></param>
{
    Condition.IsTrue(condition, MakeRequirementId(id, description));
}