-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
unify and recast "Cask name" and "title" as "token" #7673
Conversation
Just wondering, what's the rationally for using the term "token" instead of something like "title" or "id[entifier]"? I feel like token doesn't as effectively convey the fact that it's a way to (for lack of better words) name/identify a cask as much as those terms do. |
As @szhu mentioned, I think identifier would be a better term than token. When I see the word token, I generally imagine a string of letters and numbers that is not usually human-readable. |
@rolandwalker Whoa. This is the mother of all commits! @alebcay @szhu As a relatively new contributor, I would personally be perfectly fine with either identifier or token. Having said that, I do suggest that we focus on user-facing text as much as possible when making a decision – given that users obviously outnumber contributors by orders of magnitude. I admit that I have no idea as to which wording is going to work best. However to support decision-making, here is a list of six sentences from this PR which I believe that of all user-facing text that contains token, most (first-time) users are actually going to come across: Examples for text that faces first-time users
|
On the tangent of this PR, I would like to propose the addition of a top-level @rolandwalker emphasized elsewhere that it is desirable to adopt a maximally predictable approach to Cask identifiers for internal usage. The “Cask name” (as intended prior to this PR) is overloaded in such a way that our needs cannot be reconciled with those of vendors and users alike. “Proper names” should be moved out of Nonetheless, the user will still need our internal token as a reference point (e.g. in debugging, scripting, or simply |
@ndr-qef per our IRC discussion, I agree that's a good idea. @claui yes the commit is annoyingly huge. My personal guideline for commit granularity is always "what is a good future boundary for I am glad to see general agreement that moving away from "Cask Name" is a step toward clarity. As to the choice of word, that is an interesting topic. Since @szhu asked what is the rationale: There are all sorts of neat words for "the thingy", and the desire for variety didn't begin with software. Consider: "name", "token", "identifier", "argument", "parameter", "option", "key", "value", "term", "noun", "object", "subject", "element", "item", "article", "particle", "point", "bit", "tag", "descriptor" – and one could go on. Each denotes "that one particular thingy", but there is superb richness in the connotation: what type of thingy may fit, what is happening to the thingy, whether we speak of the thingy directly or a referent, etc. "identifier" is certainly reasonable, but I chose "token" because it is more abstract. As @szhu said, "token" doesn't convey that it is a way to name the Cask. Exactly. The token is just a dependable way to refer to the Cask. We make it reasonably mnemonic because we are nice, but the proper name is going elsewhere — and I do want to display those full names by default in the UI. Because I love the names, and the upstream branding. The |
Thanks for your response @rolandwalker! Just to clarify – are you suggesting that a token may not be a unique way to refer to a Cask (as in, a Cask might be able to be referred to with different tokens)? |
Good point. To keep growing, we need to lock down the internal organization around this rigid "token", which has to be unique. But to be user-friendly, we should try to open up the UI. At the very least, we should offer a "did you mean" suggestion when someone matches into the proper name. Simply accepting the proper name in place of the token might be a bad idea, because then scripts could break if names changed, and then names would have to become as rigid and conservative as tokens. But I don't like "no", I like "yes". A "yes" way to think about it would be that we are adding the missing pieces someone would need to write a GUI to drive our CLI. |
Suggestion: Use token to mean some way to refer to a cask – and this can be any way, and there can be multiple ways. Think of it as a search query. Use identifier to refer to the internal, well, identifier, for a cask (and this means there is necessarily one for each cask). In the beginning, there might be only one valid token for each cask, and it might be equal to the Cask's identifier. But the above terminology can still mean the same thing when, for example, we might have multiple tokens that refer to the same cask, or if we start using integers/UUIDs as identifiers instead of something normal users might put as a search query. |
* "Canonical App Name" becomes "Simplified App Name" * devscript `cask_namer` renamed to `generate_cask_token` * doc file `CASK_NAMING_REFERENCE.md` renamed to `cask_token_reference.md` * DSL uses `"#{token}"` for interpolation instead of `"#{title}"` * documentation text * backend code (variables, method, class names) * error message text * tests * code comments * Cask comments * emphasize `tags :name` * doc: use "vendor" consistently instead of "developer" * doc: many man page argument descriptions were incorrect * incidental clarifications Many backend variables similar to `cask_name` or `cask` have been standardized to `cask_token`, `token`, etc, resolving a long- standing ambiguity in which variables named `cask` might contain a Cask instance or a string token. In many places the docs could be shortened from "Cask name" to simply "token", which is desirable because we use the term "Cask" in too many contexts.
37d1de0
to
a335d3b
Compare
@szhu yes, we might end up doing something like that. Internally (in the code) I already wanted to say "descriptor" for the larger case, because the argument can also be a URL instead of a token. All: I would prefer to wait several days and have more discussion on this user-facing change. However, this large patch touches so many pieces of code, it is mergeblocking areas that both @claui and I want to work on. I am fairly certain that "Cask name" brought problems that were holding us back. "Token" may not be perfect, but I am satisfied that it is Good Enough. Based on the above discussion, Merging now (with some reservations about the pace). |
unify and recast "Cask name" and "title" as "token"
In numerous conversations such as #7606, b994bd7#commitcomment-8762316, and IRC, I have given the same explanation that what we call "Cask name" should not be considered the "name", and functions more like a UID or token.
So, it would save time and reduce confusion if we simply renamed it the "token" as in this PR. This makes even more sense now that
tags :name
is live.The basename of the the filename containing the Cask has always been ridiculously constrained, will continue to be constrained, and can never fully represent product branding.
This solution also resolves the conceptual conflict between "Cask name" and
tags :name
. (We purposefully didn't usetags :alternate_name
.)There was also an alternate term "title" which appeared in a few places, particularly as a method used for interpolations in Casks. "title" is also needlessly confusing. Now that we have gotten rid of Cask class names (at least as is visible to the user), there is only one descriptor for a Cask, and we need only one term for it.
This PR covers quite a bit of code as well as docs. Many backend variables and methods similar to
cask_name
orcask
have been recast here ascask_token
,token
, etc, resolving a long-standing ambiguity in which symbols namedcask
might refer to a Cask instance or a string token. This improves clarity and is a step toward a much needed refactor: using aCask::Descriptor
class instead of pushing around strings.In many places the docs could be shortened from "Cask name" to simply "token", which is desirable because we use the term "Cask" in too many contexts.
Backward-compatibility methods for
title
were sprinkled in a few places to support existing usage in Casks.CASK_NAMING_REFERENCE.md
renamed tocask_token_reference.md
cask_namer
renamed togenerate_cask_token
"#{token}"
for interpolation instead of"#{title}"
tags :name