DEV Community

Discussion on: Commenting: where?

Collapse
 
jeremyf profile image
Jeremy Friesen

I would look to Language Server Protocol (LSP) implementations to determine where you put your comments. For example, Ruby's LSP implementation (Solargraph) uses Yard documentation to provide "intellisense" support. Yard assumes the documentation is before the declaration of the class, module, or method.

If I were to put my comments after a method call, then Solargraph wouldn't find them (or worse would associate them with the next method) and I wouldn't get any benefit of tools that support LSP.

Collapse
 
vulcanwm profile image
Medea

oh damn