-
-
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
Discussion thread for ballot: "effect of selectors on subsequent placeholders" #872
Comments
Commentary on my votes in order to make sure I understand things correctly: My main priority is: Prevent situations where the same variable name means two different things in two different contexts. This includes when the variable is used in the I put a higher value on clarity, readability, and simplicity than I do on brevity.
|
@sffc Your logic is very similar to mine. I didn't vote for (G) because, while it solves a problem with the current syntax, it introduces new features and complexity that I think are distracting. In addition, it might represent additional hazard for translation processes, especially where translation memories are recalling individual pattern strings. The numbered items are linked to the specific key order rather than the selector names. I did include (F) in my voting. I don't like the lack of (chair hat ON) |
My working assumption was that we are currently choosing the semantics, not the syntax, and if (F) is chosen, the exact placement and nature of the syntax punctuation characters could be subject to further discussion. |
My bottom line is like the above comments. At all costs, avoid the situation where the formatted value is not consistent with the selected value. So that eliminates A and B. I could have put G above those, but it is a bit step backwards in terms of readability. About the others, I do favor H, because I think it has the most natural reading for anyone reading or constructing messages, and and minimizes redundancy in the syntax. D would be next on the list for that reason. |
The way I see it, MF2 will get read way more than it gets written, and most of the writing of it will consist of modifications of existing messages (e.g. translations thereof) rather than writing new messages. I also presume that MF2 will be an auxiliary language for ~everyone interacting with it, and so it has a higher-than-usual bar for making intuitive sense, and not exhibiting surprising behaviour. To that end, my strong first preference is to simplify If that's not acceptable, then I'd prefer to require the annotation when using the same variable in selectors and placeholders (option B), as that will guide message authors towards a very similar pattern as selecting on variables. This does not make it impossible to write bad messages, but it raises the bar so that doing so requires more work than doing the sensible thing. We're also never going to make bad messages impossible to write. Adding If we must complicate the This is a real problem, and we should fix it, so doing nothing (option A) is not an acceptable option either. But at least it's not quite as bad as adding even more complexity and surprises to the syntax (options C, D, H). |
@sffc said:
+1 fair enough
+1 absolutely
Disagree with this characterization. FWIW, our Why MF2.0? doc from the beginning still holds up well. The more basic design points in the data model & syntax that needed to be addressed first about MF1:
It's important to point out that Option A does not literally mean "Do Nothing". You can solve the problem through the existing
This is exactly the significant complexity that Options D, E & H all add. The comments here & previously from @aphillips @macchiati and @sffc talk in terms of a single benefit but ignore/minimize the cost of the tradeoff required to pay for it. I would like to see discussion there because that's where I disagree in my evaluation. The description of the benefits isn't wrong, but that's the whole story. Because these Options D, E & H are allowing @eemeli said:
+1. In fact, the past 11 months of post-Seville syntax discussions feel a lot like repeatedly paying for concision / ease with added complexity. Concision != simplicity. Ease != simplicity. Ease is subjective measure, but complexity is objective. Options D, E & H are easy when you understand it, but it objectively complicates the reader's ability to understand the meaning of a variable depending on In SummaryOptions D, E & H add a significant complexity to the ability for users to understand messages. I think the amount of complexity make them a non-starter, so I vetoed them. Proponents of those options should at acknowledge and address the negative impacts to the user, and whether other alternatives (Option F or Option A w/ linting) have such costs. The fact that these options re-introduce shadowing, which we previously rejected, brings up a meta-concern that comes up repeatedly. Options B requires & Option C allows syntax that would be verbose and better cleaned up with Option G involves positional arguments, which have also been previously rejected by the group early on. In programming languages, they are less readable and lead to more brittle (non-forward-compatible) APIs. The costs of this option are obvious and other options have fewer costs, IMO. I think only Option A & Option F address the problem without adding major extra complexity and without redundant requirements. I would be fine with either, although I prefer Option A with linting. it's worth pointing out that Option F is backwards compatible with Option A (status quo). |
Hmm, I mostly agree with @echeran except on two points. First, option A not only allows writing bad messages, but it makes it easy to do so and actively hides that there might be an issue. You can always fix it, but the job of syntax and API design is to make the right things easy and the wrong thing hard. This is why I put option A in last place. Second, I don't agree with the characterization that option E complicates things like D and H. As noted in the other thread, option E is equivalent to saying that .match with an expression is simply equivalent to .input followed by .match. No scopes, and easy to implement and reason about. I rejected A and B and not the others because my only hard line is that the correct message should be harder to write than the wrong message. The others are not bad enough for me to raise an objection, but I still prefer E and F. |
I don't think this is the case with option B. There should not be a case where with that option an incorrect message is easier to write than a correct one. Would you have an example in mind where this happens? |
@echeran noted:
E doesn't shadow, since it forbids annotation of an already declared variable. This was an important part of my preferring this design.
I am not sure what the significant complexity is for E?
Option F is fine by me. It's the reverse of E, in that you have to put the annotation in a declaration in order to use a selector. It requires the use of I personally think that The problems with Option A are laid out by the design document (primarily in the Use Cases). I think there is a huge negative impact to the example message (a version of which I give just below), because the selector does the wrong thing. It is exceedingly weird to me to say that this message "does not shadow
Going back to the design doc--if you think there are "negative impacts to the user", can you describe them in use case/user story language? Or are they already covered? Impacts should appear in the design doc, because it's hard to respond to assertions of impact without knowing what you mean. I'm not saying such impact doesn't exist, but by making it visible allows us to have a conversation about the relative priority of each. |
I strongly second this by @sffc:
Being able to intuit the outcome of one's message is my absolute highest priority. Convenience and brevity is near the bottom (within reason). (A) Do nothing: (B) Require annotation of selector variables in placeholders: (C) Allow both local and input declarative selectors with immutability: (D) Allow mutable input declarative selectors: (E) Allow immutable input declarative selectors: (F) Match on variables instead of expressions: (G) Provide a #-like Feature: (H) Hybrid approach, Match may mutate, no duplicates: |
There are use cases for not always doing that:
With the type of I think most people would be surprised to see "female invited you to her party}" as a result. Sure, it can be solved by saying "if you don't want consistency between match and format, you must define a I'm not arguing one or another. Only saying that I don't see this as a blocker for A or B. |
What I dislike about "(G) Provide a #-like Feature" is using a number. That makes the message dependent on the order of the selector. There are many reasons why we removed support for ordinal placeholders.
Changing the order of the selectors in match changes the message. No reason why it should. That is bad for localization. It also implies that placeholders start at
Why Lastly, even if we ignore this, the solution does not solve much. It is as error-prone as doing nothing, with added complexity with the numbers. |
+100 to sffc and bearfriend
We can assume that developers will have some kind of support from the IDE that will suggest [ Second, even if this is not the case, think about the time one spends on this as a developer. I work on a feature for 2 weeks. Write a design document, write code, unit tests, deal with UX, security, accessibility, code review & feedback implementation, etc. And for that I add 10 messages. One of them might have a selector, and we force them to be to add an explicit Brevity does not matter at all. But if they save the characters and the result is not what they expected, the bug might be only detected later. Need to fix the message, code review again, maybe fix the translation in all the languages. So clarity is paramount. Hence my vote for F above all. |
@aphillips said:
Let's think about it from the point of view of a user who has to parse messages written according to Option E. Here is what we're telling them:
The series of rules and implications above are a consequence of the complexity -- distinct separate rules being made to interact with each other unnecessarily.
I repeat my disagreement with "unnecessarily verbose". Again, Simplicity != concision. Simplicity != fewer things. We've made this point a half dozen times in this WG with the example of curly braces being optional around the branches of a C-style I far far prefer Option F over Options D, E, G, & H because of simplicity, which is achieved with a few extra characters, yes. I would much rather type extra characters ("unnecessarily") than I would have distinct separate rules interacting with each other unnecessarily (complexity).
I appreciate the intent behind this statement, and maybe this statement explains a lot of the motivation of Option E. When it comes to However, if we want to also reduce
Yes, that is an error-prone situation. Both Option F and Option A+linting are alternative ways of solving the problem. Or we get rid of the
I created #867 to record these points & examples, and fitting the concise writing style of design docs. In my previous attempt to be thorough in the Delimiting Variant Patterns, you recommended to stay concise by removing details, which I did (relegated them to a collapsed zipper). Our problem these days isn't documentation but rather better adhering to the conclusions and reviewing the decision thought processes therein. |
@echeran noted:
I don't agree with this. If you want to "reuse an annotation", you just reuse it:
I also don't agree with the gender/personName examples. I think the disconnect is here:
Actually,
You cannot think of I'll have a look at #867. |
See WG resolution at the end of #873 |
This is the discussion thread for the current ballot.
The text was updated successfully, but these errors were encountered: