Problem:
There's a big discussion about how to deal with ellipsises at #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface.
One thing that nobody seems to disagree with is that there's too many "..." styles comments and markup in Drupal. This turns simple sentences into unnecessarily vague sentences and does not seem like the best way to end a short list of items.
The policy discussion in the linked issue is long and complex and periodically creeps in scope massively.
It has been stated that "..." is missing from many languages other than English, so (ab)use of this in code can be a barrier to entry for developers who are not native English speakers.
Solution:
Delete every single "...", UTF-8 ellipsis character and &ellip; in Core that we can without changing the meaning of the text the character is situated in. If possible, complete the darn sentence properly with words that mean what they say and finish the sentence with a single ".", "?" or "!" character.
If for some reason we can't justify removing a "..." from somewhere, make a note of why and feed that back into the discussion at #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface so that we can use it as an example to help form a solid policy there.
Quick beta evaluation
This is only changing comments (API docs and in-code comments), so it is unfrozen.
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | interdiff-2279105-45-47.txt | 1.11 KB | nidaismailshah |
| #47 | 2279105-47.patch | 25.83 KB | nidaismailshah |
| #45 | 2279105-45.patch | 25.69 KB | mgifford |
| #42 | 2279105-42.patch | 25.27 KB | mgifford |
| #40 | 2279105-39.patch | 25.31 KB | mgifford |
Comments
Comment #1
thedavidmeister commentedComment #2
thedavidmeister commentedPlaces that I *haven't* removed the ellipsis:
- Where surrounded by whitespace in code examples in comments
@code ... @endcode. In this case "..." represents "your code goes here".- Vendor code
-
@param ...when we have an unknown number of additional arguments passed to a function. See drupal_register_shutdown_function()- Where the "..." characters represent clear functional usage. See drupal_html_to_text() for an example.
- Where the "..." characters are in comments, describing literal string output. See the comments of truncate_utf8() for an example (although this is a bad example because truncate_utf8 adds a … character instead, and the comments are lying) or _filter_url_trim().
- Where the "..." characters appear in raw data. See /core/lib/Drupal/Component/Transliteration/data/x18.php for an example
- Where the "..." characters denote the "middle part" of a mathematical sequence. See Number::intToAlphadecimal()
- Where the "..." characters appear as part of data for tests - see /core/modules/filter/src/Tests/FilterUnitTest.php
- Where the "..." characters are appended to a dropdown selection that implies further steps to be taken, such as "Save As..." in operating systems
- Where the "..." Indicate removal of some part of directly quoted text. E.g. "The study shows that incidents of foo have increased ... over the same period bar has decreased".
Notable places that I removed the ellipsis:
- Where "..." was being used to denote a "wildcard" such as http://example.com/... was changed to http://example.com/* as a "*" is more commonly used for wildcards
- Where "..." was being used in English lists, replaced with "etc"
- Where "..." was used to imply that there will be some passage of time before an action will be complete, "Loading...", "Please wait...", "Uploading...", "Walking the dog..."
Incidentally:
- ArchiveTar.php is a coding standards mess :(
- _filter_url_trim() and search_excerpt(), template_preprocess_username() and Views in multiple "trimmed" places should use an actual ellipsis.
Comment #3
thedavidmeister commentedComment #4
thedavidmeister commentedComment #5
mgiffordThis is a good code cleanup. I read through the code, looks like an improvement.
Comment #6
thedavidmeister commentedTo give some more context to a Core Maintainer about this issue:
Committing this patch will vastly lower the scope and eliminate many of the outstanding discussion points that are holding up the parent issue #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface.
Comment #7
alexpottConsistency?
Why are we affecting end user text in this issue? When I press submit on this comment Chrome will tell me "Waiting for drupal.org..." - is a full stop really correct in these instances? Shouldn't we be using the utf8 character as suggested in #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface?
Comment #8
mgiffordI'm fine with standardizing on http://example.com/foo
The point of this patch is to try to remove ... without the use of an ellipsis. These all look fine to me:
But ya, I'm not all that particular. I'd seek out someone who has stronger opinions on grammar.
Comment #9
jhodgdonWhy is this not in the Documentation component?
Also, if you are going to use "etc." as a replacement it needs to end in . as it is an abbreviation for the Latin word "etcetera".
I also don't think this is a great idea:
But in any case, it seems to be out of scope for the issue summary here, which is about replacing ... with other alternatives, and this substitution does not do that.
And in general, I don't think this whole issue is necessary. The issue summary does not (in my opinion) really give any good reasons why ... should not be used. Just because some other languages may not use it (and is that even true?) is not a good reason why it should not be used. We write comments and translatable text in English, and anyone wanting to read or translate it needs to understand English -- that is just how it is. Avoiding particular punctuation or words because some people might not know them is not really viable.
Comment #10
jhodgdonComment #11
mgiffordRe-rolled the patch as it no longer applied.
#7.1 Changed .htaccess to use /foo so it's consistent with web.config
#7.2 Reverted them to use '...' we can put in ellipsis in another issue but the purpose here is simplification.
@jhodgdon - I added in the "etc." where the periods were missing. Also put back in the "//" as you requested.
As far as this not being useful, it does seem to clean up a bunch of inconsistencies. It's certainly not critical, but I do think it will make it easier to consistently manage the use of ellipsis in the public interface.
Comment #12
mgiffordComment #13
amitgoyal commentedRe-rolled patch in #11.
Comment #14
longwaveI read through each change and they make sense to me. Not sure we can hope to get *every* instance in a single patch but this looks good enough for now.
Comment #15
alexpottComment #16
jhodgdonI'm not sure about this change:
So the first comment in this group has:
// ----- something
and then the others had
// ... continue with the process
I really don't think removing the ... makes the comments more clear?
There are a couple of sections like this in the patch. Why are we doing this?
This change also looks wrong to me:
I think it was trying to say "title etc."?
And here:
Now... I really do not see the point of this issue at all, as I've stated before. But if the point is that some people might not understand ... (in code comments? really????) then please do not also replace "for example" with "e.g.", which about 99% of people do not understand is different from "i.e." (it is misused a LOT). Changing it is out of scope for this issue anyway. Do not do this. Please.
Anyway... I didn't have time to review more of this patch -- I got about half-way through...
But ... Why are we really doing this anyway, in code comments? Code comments are written in English and coders will need to understand English, and no one has even found a language where ... does not exist for the other issue, as far as I know. This just seems like a waste of effort. The code comments being "fixed" here are not actually unclear as they were -- they may not be beautiful prose but they are just in-code comments and I don't really think this effort is necessary. The changes are not really clarifying anything, are they?
So... I'm not marking it as "won't fix", even though that is my opinion, but at a minimum I don't think it should be committed as it is, because I do not think everything in there is an improvement, and at best I think it is kind of a waste of time.
Comment #17
mgiffordThanks for your feedback @jhodgdon.. I dropped the fragment for function _writeHeader() & ManageDisplayTest.php, and also took your suggestion to go with "('title'), etc.".
The point of this issue is to where possible remove "..." so that we can more consistently use ellipsis in D8. I'm personally not all that worried about it being in the comments and other places, but heck, if we can clean it up and get rid of a few characters, great....
The point is consistency... That and if we eliminate "..." then we don't have to worry about converting it to an ellipsis.
This is mostly a supporting issue to prepare the way for this issue from 2006 as far as I am concerned #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface.
Comment #18
jhodgdonWe definitely should not be using ... in code comments. They are not ASCII characters. Anyway... as I don't think any of the changes that were previously in the patch actually added to the clarity of the in-line comments, and standards compliance has also not been improved by this patch, I still do not see the point.
Comment #19
mgiffordGood point about code comments being restricted to ASCII.
Comment #22
rpayanmhere the reroll.
Comment #24
rakhimandhania commentedRe-rolled the patch and adding the updated patch.
Comment #25
jhodgdonThanks for the new patch! There are several problems though:
a) This change in .htaccess doesn't look right to me:
If we change the first ... to foo, we should also change the second ...
And then this other one is also wrong:
In this case if we change the second we should also change the first. Both of these are about redirecting www.somethign to no-www and vice versa.
b) in core/lib/Drupal/Core/Archiver/ArchiveTar.php in _writeHeader() method:
Wrong indentation.
c)
The punctuaion here is incorrect. If you are going to use "e.g.", it needs to be "... several values; e.g., checkboxes...". Or better yet replace it with "several values; for example, ..."
d) The two hunks in comment.module have the same problem as (c). So does core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php and entity.api.php and taxonomy.module -- and we have a general policy that when fixing up a docs line, we should fix all the problems in that line, so it would be good to fix these.
e)
What is "inpurs", can we change that to 'inputs"? Actually we don't have non-field inputs in 8 do we? This whole comment is suspect.
f)
Actually, these types of changes, where you add a space before a ..., are not correct. When you put ... in an English sentence, there should not be a space before it.
g)
That . after work should be a ,
The rest looks OK, but I'm still not sure why we're even doing this?
Comment #26
mgiffordWe're doing this to help close this issue from 2006 #44987: [meta] Use the UTF-8 ellipsis character instead of "..." in the user interface if we don't need to use "..." then we don't need to convert them to proper "…".
This isn't a functional problem, but it would be nice to use the proper UTF-8 ellipsis character more often in Drupal 8.
Comment #27
jhodgdonThanks, actually I see that information is in the issue summary. Anyway, patch still needs a bit of work...
Comment #28
ameenkhan07 commentedjhodgdon: Made the changes you referred to
Comment #29
linl commentedThanks @ameenkhan07 and welcome to Drupal!
If you set the status to "Needs review" the testbot will run and test the patch for you.
Comment #33
mgiffordjust a re-roll.
Comment #36
jhodgdonThis is mostly OK... A few things still to fix:
I do not know if we are really maintaining ArchiveTar. This class has ***many*** problems with coding standards, and I think we either need to overhaul it completely (in another issue) or leave it alone.
The punctuation of i.e. is not correct here. It needs a comma after i.e. or better yet just remove it because it doesn't add anything to the comment really.
This line goes over 80 characters.
This is incorrect. When ... follows a word, there should not be a space before it.
Comment #37
mgifford1. NP on ArchiveTar.php, we don't want to muck with it. Not sure how this is related to NestedArray.php
2. Ok, I've removed "(i.e. remove folder/* segments)"
3. Thanks.
4. Ok. NP.
Comment #38
jhodgdonOK, one more thing that either changed recently or I totally missed in previous reviews (if so, sorry):
We should not have both for example and e.g. in this line? ?!?
Also I don't get why we're removing e.g. and replacing with "for example" in some places and not others. It is either out of scope for this issue (in which case don't do it anywhere) or we should be consistent and do it everywhere?
Comment #39
mgiffordOk, fixed the "example, e.g." redundancy. Also fixed a change to the core/modules/user/user.module file so that the patch would still apply.
I also standardized on "e.g.,". If someone wants to change it to "for example", we can make that a new issue.
Comment #40
mgiffordwoops.. Here's the patch.
Comment #41
jhodgdonLooks good now, except in user.module:
Patch adds an extra space to the end of this line.
You may want to check the rest of the patch for similar... I didn't see anything but may not have checked it all. I only noticed this one because the patch showed this line changed, and I wasn't sure why.
Comment #42
mgiffordSorry I missed that.. Just a re-roll sans-spaces.
Comment #43
mgiffordOh ya. Noticed this a missing "." - in
+ // Doesn't display SUM, COUNT, MAX, etc. functions in SELECT statementWorth adding it in this patch?
Comment #44
jhodgdonOK, one more pass...
This makes the line go over 80 characters. Needs rewrap.
Yes, if you're fixing this line of comment anyway, might as well add a . at the end. Actually the beginning of this line should not be capitalized either, because it's part of the previous line's sentence.
Comment #45
mgiffordOk, here's a reroll.
hook_field_widget[_WIDGET_TYPE]_form_alter()is just so long. I wasn't sure if I should continue this path in WidgetInterface.php.Added the . & fixed the capitalization in #45.2
Comment #46
jhodgdonThanks! Still one problem:
This line goes over 80 characters still. The function name needs to be moved to the next line and the rest of the paragraph needs to be rewrapped.
Comment #47
nidaismailshah commentedFixes as per #46.
Comment #48
jhodgdonThanks everyone! This looks good now.
Added line about beta eval to issue summary (this is only comments/docs).
Comment #49
alexpottThis only conflicts with #2496053: Rename xmlhttprequest to jqXHR in Drupal Ajax JS in the rtbc queue. Therefore going to commit this now rather than having it hang around.
Committed 23e7b47 and pushed to 8.0.x. Thanks!
Reflowed the comment on commit.
Reflowed the comment on commit.