-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Naming things #248
Comments
Comments migrated from the slidesSlides comment, Mihai Nita (@mihnita), 1:47 PM Apr 21 Maybe bikeshedding, but I don't think this is a good name. If these are things that the user passed to .format, and will end up passed to the formatting function, then they are arguments, or parameters if you are in the function definition or the function caller. But not variables. Which exist outside the function definition / function call.
In the example above e is a variable. But the function would never see it. |
Comments migrated from the slideslocal variables Slides comment, Elango Cheran (@echeran), 11:37 AM Apr 21 Is this what was also referred to in other proposals as aliases or macros? If so, can we use one of those other words? "local variable" implies something is varying, but the alias/macro functionality can/should really be seen as creating a local immutable binding. Slides comment, Eemeli Aro (@eemeli), 12:31 PM Apr 21 Yes. The name for this concept was discussed at some length during the MFWG call on 7 Feb. At that meeting, the term "local variable" was seen as less conflicting than either "alias" or "macro". This discussion is summarised here: #220 (comment) Slides comment, Elango Cheran (@echeran), 1:04 PM Apr 21 On this topic, the only reference I see in the notes / issue is: As both "alias" and "macro" have strikes against their use, let us refer to the entities under discussion as "local variables". As I see it, "local variable" has a strike against it, too. IMO, the strike is bigger than the other two options. I've seen the other two terms have overloaded meanings in different places and people be okay with that. In contrast, I just don't recall "local variable" used anywhere outside of a programming language, and it implies a particular meaning. |
Similar to above, I think "variable" has a distinct meaning in a programming language context -- something whose value can change. If we're talking about a pattern
Same logic as above. I would prefer "alias" over "macro", while "local variable" is a misnomer.
I can't reproduce the exact discussion where we agreed "placeholder" is preferable, but as I remember it, placeholder it's a standard term in l10n tooling and specs, whereas the "-able" suffix in software almost always implies an interface (ex: Java JDK). The result of that discussion was incorporated into #30 |
I think this is crux of misunderstanding: we choose different moments of a translation's lifetime when we pick the name for variables/arguments. You say by the time we see a value..., and you're right that given the following message:
...the value of At the same time, this same message can format as Elango added a new photo to his album. or as Staś added a new photo to his album. The user's name varies between formatting operations; it is in fact variable. Furthermore, I agree with you and @mihnita that if we look at a message as a blackbox with input and output (like a mathematical function), we could call them arguments. The trouble I see with this name, however, is that at the same time we also plan to have a function registry with functions, and these functions will take arguments. For example, in |
Re. the placeholder, do we want it to be the name of anything between Assuming the following syntax for UI elements:
Are |
I would say yes. I think placeholder is a catch-all term for a container within a message that can either hold an expression or markup. If we eventually add message references, they too would be in a placeholder. Also, I don't think the term "placeable" is really useful due to its similarity/overlap with placeholder. Using both and defining them with different meanings would be pretty certain to cause confusion. |
Agreed. I am to blame for (re-)introducing |
Hmm, what you described is analogous to a parameter when you write the source code for a function in a programming language. The values assigned to a parameter should be constant within the scope of the function, but of course, the argument values passed into those parameter names can differ from one invocation to the next. I think the real difference here is that most languages are not immutable-only-ish, so you may use a local variable to give a name to something, even if you don't mutate (vary) it. (If not for readability or caching the result of an expensive operation, it wouldn't make sense to create a mutable variable within a lexical scope but never mutate it.) When you are using an immutable-only programming language, you can't call it a variable, so you call it a binding. I think binding is also a better choice here. But maybe I'm the only one who thinks the phrase "local variable" evokes the idea of mutation in a programming language, and that it doesn't fit. If so, then that's fine, although I wouldn't agree, still.
Yeah, I'm not too particular here. I agree that maybe different names can help. Existing ICU MF calls the names "arguments", and I think the EM proposal called the logical key-val entries like |
|
All names (from Marcus's comment) sound fine to me. |
I would like to "touch" this one and maybe schedule some names for discussion. The current spec was a bit of "in a rush", with focus mostly on "let's get it to a decent shape for the ICU tech preview" But it might be the time to visit them? Examples:
Kind of suggests that it is mutable, and it is evaluated at definition time
But we don't apply an "annotation" on an "operand". Or going a bit deeper, we don't invoke a "function" on an "operand"
Is that section I think that |
Does the adoption of the abnf answer this issue? The names in the abnf are specific and become our jargon? |
Closing per 2023-06-19 telecon discussion |
We've been using all kind of names in our separate proposals, and never managed to unify.
But names are important, and it's about time to decide on this.
Some examples:
TODO: add more
The text was updated successfully, but these errors were encountered: