Commenting standards are critically broken in tabledrag.js. As we all know, following commenting standards makes comment readable, and should be followed by all of Drupal core, especially considering how Drupal core is an example for contrib. The attached patch fixes all the broken commenting standards in tabledrag.js.
Comment should start with capital letters all the time, so as to distinguish it further from actual code. This is especially important for end line comments (comments that come on the same line as the code). For example, all the lines in tabledrag.js such as
<?php
element = element.firstChild; // a table cell
?>
need to be changed to following commenting standards, as we can see with:
<?php
element = element.firstChild; // A table cell
?>
The latter is clearly by far the much more readable of the two options, and the one we should be using.
Lastly, this patch makes tabledrag.js coding standards compliant, and since both awesome javascript and awesome coding standards contribute to Drupal's awesomeness, this patch has a double-awesomeness benefit in that it is not only fixing coding standards, it is also fixing javascript. This patch needs to be applied if Drupal is to keep up its reputation as the most awesome CMS in existence. Thank you.
Comment | File | Size | Author |
---|---|---|---|
#3 | tabledrag_commenting_standards_003.patch | 2.61 KB | cwgordon7 |
#2 | tabledrag_commenting_standards_002.patch | 640 bytes | cwgordon7 |
tabledrag_commenting_standards_001.patch | 639 bytes | cwgordon7 | |
Comments
Comment #1
catchMissing a full stop at the end of the comment to go with the capital letter at the start.
Comment #2
cwgordon7 CreditAttribution: cwgordon7 commentedcatch is right.
Comment #3
cwgordon7 CreditAttribution: cwgordon7 commentedUpdated patch with simpletests.
Comment #4
cwgordon7 CreditAttribution: cwgordon7 commented..bump?
Comment #5
floretan CreditAttribution: floretan commentedPatch from #2 works. We don't need a test for this.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.