3 ms·
// CSINameTranslator can get the CSI Driver name based on the in-tree plugin name type CSINameTranslator interface { GetCSINameFromInTreeName(plugin
by zoogeny 2y ago
// CSINameTranslator can get the CSI Driver name based on the in-tree plugin name
type CSINameTranslator interface {
GetCSINameFromInTreeName(pluginName string) (string, error)
}
Do people actually find comments like the above useful?
- deleted 2y ago[deleted]
- jakevoytko 2y agoOn a big open-source project like Kubernetes, they're probably happy with the tradeoff between "some exported names have inane and obvious comments" and "our linter requires open-source contributors to document their exported names in a consistent way."
- sollniss 2y agoWith the official linter (golint), exported types must be commented, so sometimes you get Captain Obvious comments like this.
- kmoser 2y agoYes, if it's your first day on the job and you don't know that CSI is a driver. Yes, if GetCSINameFromInTreeName ever gets renamed to something less obvious.
- rk06 2y agoyep, they are useful. I consider comments to live at "conceptual" level while code lives at "physical" level. With this way,when you are debugging, your mind can read code at conceptual level and easily disregard irrelevant blocks of code. without comments, i will need to mentally drop down at physical level and implement a compiler in my brain for the same results
- akvadrako 2y agoIn this example it's faster for me to understand what the code does by reading the comment than to parse the code itself. If you're just scanning over a lot of code and looking for what you care about it could be helpful.