> // constructRoutingTree constructs routing tree according to provided routes
> // gearbox implements Gearbox interface
> // New creates a new instance of gearbox
It's obvious from the names of the functions WHAT they do. The point of the comments are to tell me WHY they are necessary. The project feels like commenting for the sake of commenting. I honestly don't know why a "routing tree" is necessary and how it's helping.
The problem I have with Go is that it does not show an object implements any interface. The implementation is implicit, i.e. you implement the method signatures, and you implement the interface. That particular comment is actually quite useful.
This is because golint complains if you do not write a comment above an exported function. While it does indeed seem silly when reading the code, the purpose is for the go documentation that is automatically generated from this.
Go's stance is that it is better to always have people document exports, even if some are trivial and duplicates, it is better to always enforce it so that comments are there for the exports that do benefit from a "why".
If you really hate the comments, in your own projects you can use Revive which is a drop-in replacement for golint and allows you to disable lint rules like comment annotations.
I think it's great it forces you to write a comment for an exported function but why the hell do I have to write down the function name again?!? It's literally 1 line below. Can the analyzer tool not grab the name of the function from that?
It makes these comments very frustrating and also more annoying to read because you always have duplicate text.
We wanted to make everything clear. We do routing using Radix tree (https://en.wikipedia.org/wiki/Radix_tree) and we call it routing tree. BTW, more documentation are on way to be added
> // constructRoutingTree constructs routing tree according to provided routes
> // gearbox implements Gearbox interface
> // New creates a new instance of gearbox
It's obvious from the names of the functions WHAT they do. The point of the comments are to tell me WHY they are necessary. The project feels like commenting for the sake of commenting. I honestly don't know why a "routing tree" is necessary and how it's helping.