gpt4 book ai didi

c# - 代码注释 : Do you put your code comments on Interfaces or on Concrete classes, 或两者?

转载 作者:太空狗 更新时间:2023-10-29 17:28:30 24 4
gpt4 key购买 nike

<分区>

记录类和接口(interface)的最佳实践是什么。假设您有一个名为 Foo 的具体类,它派生自一个名为 IFoo 的接口(interface)。你在哪里发表你对你的方法的评论?您是否重复对接口(interface)和具体类的评论?

这是一个重复评论的例子:

public class Foo : IFoo
{
/// <summary>
/// This function does something
/// </summary>
public void DoSomething()
{
}
}

public interface IFoo
{
/// <summary>
/// This function does something
/// </summary>
void DoSomething();
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com