-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Make minor grammar corrections/updates #1612
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
Conversation
There should be a space before dashes that you propose, such as @paroche could you please review that? |
Yes, space also before dash, There is a style which has no spaces on either side, and a style with spaces on both sides. For instance, newspapers that follow the AP style have spaces on both sides. That's what I favor in general. Here: It does seem to be the case that in American-style writing the commas go inside quotes, so the change would be "right", though I'm not a fan of that rule. Are a lot of changes here, some OK, some not. Kind of hard to comment on the whole thing. But oh well.... Here we did it in Change is an improvement. Or could say "but, of course, it's...". How can we load two scripts sequentially: the first one, and then the second one after it? I don't think this is particularly an improvement. It's a matter of taste. I prefer the original. In the above examples we didn't consider errors. What if the script loading fails? Our callback should be able to react on that. I think it's better w/out the comma (1st change). But definitely, "to" is better than "on". Also, the functions named Either a space before the dash, or use a semicolon (";"). _1. A "producing code" that does something and takes time. For instance, a code that loads the data over a network. That's a "singer".
Having commas and periods inside the quotes is the American style. So yes to the changes. (My understanding is that the Brits put the ending punctuation outside the quotes, which I think is more logical). I don't love that rule and it looks especially weird to me when it's only one word in quotes, but that does seem to be the way it is. That is, Yes to the "the" before
I like it better with the comma, though it's correct either way. A bigger example with fetching user information for an array of GitHub users by their names (we could fetch an array of goods by their ids, the logic is identical): I'm not really in favor of either change. For example, I prefer keeping the comma. Slightly better without 'that'. For everything not mentioned, I'm OK with the changes, or at least somewhat neutral. Or, I didn't notice them. |
@paroche thanks, so do we stick to As I got it, we require spaces around a dash. Any other changes we require PR author to make? Or we just take nothing from it and close it? Also, when you'd like to correct an exact sentence, there's a way in GitHub to do that, probably you know, the "plus" sign that appears here: And then "Review" button in the upper-right corner allows to request changes. |
I would not really want to see you change all the ".....", s to ".....," s. That is considered a rule in American usage but I think it's stupid, and despite many years of reading English it still looks strange to me. It is apparently (I've read) a holdover from manual typesetting when it helped keep the little commas and periods from falling off the plate. So I think it would be fine to stick with the British style for this, at least for lists of quoted items and the like: 'The boxes I see are labeled "red", "green", and "blue", but I think somewhere there's one labeled "purple". In the preceding, I especially prefer the comma to be after "blue". I could live with the period being inside of "purple.", but still wouldn't favor it (though it does look somewhat comfortingly familiar that way). Also, since this is technical writing, sometimes the things in quotes have to be taken literally, and a comma inside the quote could confuse things. As far as the other changes, I have already expressed my opinions on most of them -- some of them are good, some are marginally better, some, in my opinion, slightly less good, some I didn't like, and the ones I didn't comment on I thought were at least OK. So I don't know how you should proceed with the PR. I think I may have known about the "+" thing in GitHub at one time, for a little while. |
@jchue thank you for your effort! Could you please update the Pull Request according to the discussion? |
You mean start a discussion on each of the, what, 70?, lines being edited? Or is there a way to change them directly (without creating a new PR)? The former would be incredibly tedious. The latter might be workable. |
The author may correct the PR by pushing more commits. Or we can just manually import some worthy changes from this PR and close it. |
@paroche maybe you could review that and just push to master the good changes? I can do that myself, but I'm unable to validate all the changes. They are not about the content, but about the grammar. So if you approve everything (Except the quotes and the spaces around dash), let me know, then I'll do that. |
Gents, I have no issue making the changes. Just let me know what you prefer. Would it help if I updated the quotes and dashes first and/or broke up the PR into smaller portions to help with your review? |
@paroche, please respond as you're the grammar guy in the room =) |
If jchue would revise his changes w/ respect to the spaces before dashes and leaving the punctuation out of the quotation marks, and perhaps consider my other opinions from my long comment above, then break it into more bite-sized pieces, that would be cool. Not sure which comment you were asking me to respond to. |
Rephrasing what does delegation do for us question.
'alternative of' -> 'alternative to'
'add same handling' -> 'add the same handling' 'and alike' -> 'and the like' 'if' -> 'whether'
in the control control forms section, fixed mistake selectionEnd and selectionStart were both said to be start position
Removed duplicated `also`.
added a missing word
'and want' to implement...
'that allow to' -> 'that allow us to'
'allows to' -> 'allows us to'
'use the event delegation' -> 'use event delegation'
Adding 'object' after 'Property descriptor' -- even though it is said not far above that the 'property descriptor' returned by `Object.getOwnPropertyDescriptor` is an object, I think it wouldn't hurt to discretely include that info here (though of course it's also implied by the usage in the examples). Especially if someone is quickly scanning the article looking for `Object.defineProperty` and didn't just read the part above.
const bigInt = 1234567890123456789012345678901234567890n; | ||
``` | ||
|
||
As `BigInt` numbers are rarely needed, we devoted them a separate chapter <info:bigint>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest "we devoted a separate chapter to them...". (as is is ungrammatical).
Now let's write something very small. Say, 1 microsecond (one millionth of a second): | ||
|
||
```js | ||
let ms = 0.000001; | ||
``` | ||
|
||
Just like before, using `"e"` can help. If we'd like to avoid writing the zeroes explicitly, we could say: | ||
Just like before, using `"e"` can help. If we'd like to avoid writing the zeroes explicitly, we could say the same as: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend "say the same thing as:". Or, maybe better, just "say instead:"
@@ -271,13 +274,11 @@ JavaScript doesn't trigger an error in such events. It does its best to fit the | |||
```smart header="Two zeroes" | |||
Another funny consequence of the internal representation of numbers is the existence of two zeroes: `0` and `-0`. | |||
|
|||
That's because a sign is represented by a single bit, so every number can be positive or negative, including a zero. | |||
That's because a sign is represented by a single bit, so it can be set or not set for any number including a zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the original. Or, to get more wordy: "...a single bit which can be set for any number, so every number can be positive or negative, including zero". But I find it pretty clear the way it is (or was).
To me "set" does not necessarily mean "set to '1'" -- it could also be set to '0'. So I don't see "set or not set" as being necessary.
|
||
- Append `"e"` with the zeroes count to the number. Like: `123e6` is `123` with 6 zeroes. | ||
- A negative number after `"e"` causes the number to be divided by 1 with given zeroes. That's for one-millionth or such. | ||
- Append `"e"` with the zeroes count to the number. Like: `123e6` is the same as `123` with 6 zeroes `123000000`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was OK the way it was, but if you're going to do it this way, it would be better with a colon after "zeroes":
"the same as 123
with 6 zeroes: 12300000
.
- Append `"e"` with the zeroes count to the number. Like: `123e6` is `123` with 6 zeroes. | ||
- A negative number after `"e"` causes the number to be divided by 1 with given zeroes. That's for one-millionth or such. | ||
- Append `"e"` with the zeroes count to the number. Like: `123e6` is the same as `123` with 6 zeroes `123000000`. | ||
- A negative number after `"e"` causes the number to be divided by 1 with given zeroes. E.g. `123e-6` means `0.000123` (`123` millionth). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(123
millionths)
```smart header="No way to handle `delete`" | ||
There's no similar method to handle deletion of an accessor property. Only getter/setter methods may exist. | ||
``` | ||
As the result, we have a "virtual" property `fullName`. It is readable and writable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of liked the "in fact does not exist" part. Though that is already implied by "virtual", a bit of emphasis can be helpful. (Though I would have been tempted to rephrase it as "but does not in fact exist"). Without it, "It is readable and writable" seems to just kind of hang there.
let sortedRows = Array.from(table.rows) | ||
.slice(1) | ||
.sort((rowA, rowB) => rowA.cells[0].innerHTML > rowB.cells[0].innerHTML ? 1 : -1); | ||
let sortedRows = Array.from(table.tBodies[0].rows) // (1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. 😎
|
||
Here we mention negative `width/height` only for you to understand why these seemingly duplicate properties are not actually duplicates. | ||
In practice though, `elem.getBoundingClientRect()` always returns positive width/height, here we mention negative `width/height` only for you to understand why these seemingly duplicate properties are not actually duplicates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If keeping it all as one sentence, recommend moving the comma: "In practice, though elem....
.
Either that or change later part to "...width/height. Here we ....". And maybe have commas on both sides of 'though':
"In practice, though, elem...
always returns positive width/height. Here we mention ..."
That would be my first choice.
@@ -20,9 +24,15 @@ | |||
top: 0; | |||
} | |||
|
|||
.tooltip { | |||
#tooltip { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the styling had suddenly changed!
|
||
There are other situations when a third-party script adds something into our document, and we'd like to detect, when it happens, to adapt our page, dynamically resize something etc. | ||
|
||
`MutationObserver` can easily handle this. | ||
`MutationObserver` allows to implement this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" allows us to implement this"
- `formData.delete(name)` - remove the field with the given `name`, | ||
- `formData.get(name)` - get the value of the field with the given `name`, | ||
- `formData.has(name)` - if there exists a field with the given `name`, returns `true`, otherwise `false` | ||
|
||
A form is technically allowed to have many fields with the same `name`, so multiple calls to `append` add more same-named fields. | ||
|
||
There's also method `set`, with the same syntax as `append`. The difference is that `.set` removes all fields with the given `name`, and then appends a new field. So it makes sure there's only field with such `name`, the rest is just like `append`: | ||
There's also method `set`, with the same syntax as `append`. The difference is that `.set` removes all fields with the given `name`, and then appends a new field. So it makes sure there's only one field with such `name`, the rest is just like `append`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
'only one field with such a name
. The rest is ..."
or 'only one field with such a name
; the rest is..."
or 'only one field with such a name
, then the rest is..."
would be better. Probably prefer the last option.
Namely in the Async section