<p>I've started using golint to help clean up my packages. I've got an interface called buffer.BufferAt which golint suggests changing to buffer.At. I don't think anyone is using this repo yet, but it's got some attention over the weekend. Does it make sense to make this change?</p>
<p><a href="http://godoc.org/github.com/djherbis/buffer#BufferAt" rel="nofollow">http://godoc.org/github.com/djherbis/buffer#BufferAt</a></p>
<hr/>**评论:**<br/><br/>mdwhatcott: <pre><p>Tools that help enforce a convention (like golint) can be very helpful a great deal of the time. Such tools also lack the context of your mental model of the application and are therefore at a disadvantage some of the time. If "BufferAt" more effectively conveys what's going on under the covers, or if it aids readability of the surrounding code, or if there's some other good reason for keeping it that way then who cares what golint says? Do what you think is best. Sometimes brevity hurts more then helps, and repetition isn't always bad. Just my 2 cents (but be warned, <a href="http://michaelwhatcott.com/go-code-that-stutters/" rel="nofollow">I still use "this" and "self" for receiver names</a>).</p></pre>nathj07: <pre><p>Ok, so I haven't read your code but perhaps you could remove the stutter and use a word other than At. I have started to try and avoid stutters in code as for me they slow down reading and understanding. </p></pre>djherbis: <pre><p>Well I have a Buffer interface, and BufferAt is a Buffer which also is a io.ReaderAt, and io.WriterAt. I do try to avoid stutter, but in this case I think BufferAt is more descriptive. I'm not sure something other than At would be appropriate.</p></pre>AYBABTME: <pre><p><code>BufferAt</code> sounds fine to me, more than just <code>At</code>.</p></pre>djherbis: <pre><p>Thanks, I don't like go against the tool but At felt a little brief.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传