-
Notifications
You must be signed in to change notification settings - Fork 14
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
Deprecate the @usecase scaladoc tag ? #584
Comments
yes please! I would like to see this deprecated in 2.13 (and then removed in 2.14 or 3.0, whichever) |
Using @olafurpg's https://github.com/olafurpg/scala-repos, which is about 2.3 MLoC of Scala: 21:54:41 $ tokei
---------------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
---------------------------------------------------------------------------------------
BASH 1 86 50 21 15
HTML 1 66 65 0 1
Markdown 143 13880 13880 0 0
ReStructuredText 3 109 109 0 0
Scala 27497 3260660 2291063 559285 410312
Plain Text 65 3749 3749 0 0
---------------------------------------------------------------------------------------
Total 27710 3278550 2308916 559306 410328
--------------------------------------------------------------------------------------- there's only 1 usage of
|
I also think that we should kill it.
This problem may be better solved by careful API design and improving how we display the full signatures. For instance, implicit parameters may be slightly faded. |
I liked it when it was introduced, but I think that generally it would be better, in 2018, to document use-cases with actual code samples, compiled. |
@smarter - killed it in Dotty too? |
I do think @usecase has a role to play so I would be against killing it, and would prefer to improve its implementation and documentation. The usecase of @usecase is this: In a highly generic library we have situations where the general inherited type template is not the type the user of an abstraction should be shown. We need a checked way to present the relevant type. Simply dropping usecase does not solve this. Here's a super-simplified example:
In the ScalaDoc for
since that's the relevant info for
is much less useful, since
If there's a way to do this without usecase, great. But as long as there isn't, usecase has a role to play. |
see also scala/bug#8887 |
1,420 Scala source files on Github still use |
@usecase
was introduced to make some signatures less scary, but it can be confusing and sometimes downright misleading (e.g. https://www.scala-lang.org/api/2.12.7/scala/collection/Map.html#map[B](f:A=%3EB):scala.collection.Map[B]).With the collection redesign in 2.13,
@usecase
is almost not used anymore, the remaining usage is giving "simpler" signatures that violate variance checks (and this isn't done consistently, e.g.List#::
gets a usecase butList#:::
doesn't):(Github search doesn't like "@" apparently so I can't say how much this is used in the wild, but I would guess very rarely)
Given the implementation complexity of
usecase
(it ties documentation generation to typechecking), it may be time to rethink whether this is a feature we should support at all. What do people think ? /cc @odersky @DuhemmThe text was updated successfully, but these errors were encountered: