Skip to content

Editorial: simplify a step in SetValueInBuffer#3819

Closed
michaelficarra wants to merge 1 commit intomainfrom
SetValueInBuffer
Closed

Editorial: simplify a step in SetValueInBuffer#3819
michaelficarra wants to merge 1 commit intomainfrom
SetValueInBuffer

Conversation

@michaelficarra
Copy link
Copy Markdown
Member

No description provided.

Comment thread spec.html
1. Let _execution_ be _AR_.[[CandidateExecution]].
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; else let _noTear_ be *false*.
1. If _isTypedArray_ is *true*, let _noTear_ be IsNoTearConfiguration(_type_, _order_); else let _noTear_ be *false*.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this simplified? it's just moving where the "let" happens, and making only one of the possible values be hardcoded, which seems at best the same, and at worst more complex

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @ljharb: the new version is shorter, but the older one is simpler to read.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wrote this line out as code, it would look like

let noTear = isTypedArray && IsNoTearConfiguration(ty, order) ? true : false;

which would be flagged by probably just about any linting configuration. The way we would actually write this in code would probably look something like

let noTear = isTypedArray && IsNoTearConfiguration(ty, order);

but the best we can do in spec text is the equivalent of

let noTear = isTypedArray ? IsNoTearConfiguration(ty, order) : false;

which definitely seems better than the first example to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buuuuuut it's not code, it's prose. And as prose, the current text is more readable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah keep the original, not a fan of this change

@michaelficarra
Copy link
Copy Markdown
Member Author

🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants