Skip to content

How to Handle Docstrings #39

@cooncesean

Description

@cooncesean

We're having an internal discussion on our team about the best practice for handling docstrings. In Python, we'd do something like:

"""This is a module level docstring."""

class SomeClass(object):
    """This is a class level docstring."""

   def some_method(self, arg1, arg2):
       """This is a method level docstring."""

In coffeescript, we'd like to mimic the pattern:

### This is a module level docstring. ###

SomeObject =
    ### This is an object level docstring. ###

    someMethod: ->
      ### This is a method level docstring. ###
      ...
      # Some inline comment
      ...

I like this approach as it distinctly separates "docstrings" from inline comments, but it appears that triple ### renders a multi-line comment to the compiled javascript -- which is probably undesired in most cases.

Any guidance would be helpful - thx :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions