Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@returns v.s @return - ambiguity causes inconsistency #550

Open
fab1o opened this issue Sep 16, 2019 · 3 comments
Open

@returns v.s @return - ambiguity causes inconsistency #550

fab1o opened this issue Sep 16, 2019 · 3 comments

Comments

@fab1o
Copy link

fab1o commented Sep 16, 2019

This is a question/issue/feature request.

In the documentation, https://esdoc.org/manual/tags.html, there is no reference to @returns. I couldn't find it anywhere. I could only find @return as the correct tag.

However, when @returns is used in the code, the docs are still generated correctly, as if we used @return.

This ambiguity causes inconsistency in codebases if different team members use different tags.

To fix this issue, team members have to be aware of this and stop using one or the other.

Preferably stop using @returns, but if a project grows so much to the point that @returns is in 95% of the code base, then it makes it difficult to argue in favor of @return.

A better fix would be if ESDocs sticked with its Documentation and supported @return only.

Another fix would be if ESDocs supported @returns only and updated its Documentation accordingly.

But not both.

Insights?

@fab1o fab1o changed the title @returns v.s @return @returns v.s @return - ambiguity causes inconsistency Sep 16, 2019
@fab1o
Copy link
Author

fab1o commented Sep 16, 2019

There's inconsistency even in ESDocs' own source code: https://github.com/esdoc/esdoc/blob/38ad523936d425278cc037c9c0e11338faa2709b/src/Parser/ParamParser.js
https://github.com/esdoc/esdoc/blob/master/src/Parser/ParamParser.js

Imagine a huge project with thousands of files.

@fab1o
Copy link
Author

fab1o commented Sep 16, 2019

Given that it seems to there're more @returns than @return in ESDocs own source code.

Documentation needs to be updated to support it. And It would be nice if it didn't support @return to avoid ambiguity and inconsistency.

@bbusschots-mu
Copy link

I strongly disagree that either @return or @returns should be removed. Instead, the docs should be updated to make it explicit that @return is an alias for @returns. This is how JSDoc handles this situation. It is similar to @param, @arguments & @arg.

One final point, @returns is more in keeping with @throws, so it is definitely the most consistent of the two options. Because @returns is not documented I use @return, and it drives me nuts that it's @return followed by @throws on the next line 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants