Bug 55503 - Fix misspelled word in build-webkit's checkForJavaSDK() and sort forward declarations
Summary: Fix misspelled word in build-webkit's checkForJavaSDK() and sort forward decl...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 13:44 PST by Daniel Bates
Modified: 2011-03-06 17:11 PST (History)
2 users (show)

See Also:


Attachments
Patch (2.69 KB, patch)
2011-03-01 13:45 PST, Daniel Bates
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2011-03-01 13:44:02 PST
It is unnecessary in Perl to explicitly write "()" in function prototypes for functions that take no arguments. So, we can remove the "()" from the function prototypes for writeCongrats(), checkForJavaSDK(),  and unlinkZeroFiles().

Additionally, the word "download" is misspelled in the message printed in checkForJavaSDK().
Comment 1 Daniel Bates 2011-03-01 13:45:32 PST
Created attachment 84288 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-03-01 18:04:37 PST
Comment on attachment 84288 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=84288&action=review

rs=me, assuming this is considered "good perl style".

> Tools/Scripts/build-webkit:44
> +sub checkForJavaSDK;

I guess this is good perl?  Looks strange to a non-perl-er.
Comment 3 David Kilzer (:ddkilzer) 2011-03-02 09:21:31 PST
(In reply to comment #2)
> (From update of attachment 84288 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84288&action=review
> 
> rs=me, assuming this is considered "good perl style".
> 
> > Tools/Scripts/build-webkit:44
> > +sub checkForJavaSDK;
> 
> I guess this is good perl?  Looks strange to a non-perl-er.

I'm not particularly fond of this style.  I like my functions to have parenthesis, even if it makes them more C-like.
Comment 4 David Kilzer (:ddkilzer) 2011-03-02 09:22:16 PST
(In reply to comment #3)
> I'm not particularly fond of this style.  I like my functions to have parenthesis, even if it makes them more C-like.

But not enough to oppose this change.  (Which style is more prevalent in the tools Perl code?)
Comment 5 Daniel Bates 2011-03-02 10:23:17 PST
(In reply to comment #4)
> (In reply to comment #3)
> > I'm not particularly fond of this style.  I like my functions to have parenthesis, even if it makes them more C-like.
> 
> But not enough to oppose this change.  (Which style is more prevalent in the tools Perl code?)

Using some regular expressions against webkitdirs.pm and VCSUtils.pm (*), the empty parentheses notation is more prevalent than the no-parentheses notation (which is proposed in this patch). So, I can change this patch only be a spelling correction and sorting of the forward declarations.

For completeness, the sentiment on #perl on freenode seems to be against all uses of prototypes. They referred me to the Usenet post <http://groups.google.com/group/comp.lang.perl.modules/msg/84484de5eb01085b?dmode=source&output=gplain>.

(*) I used the following regular expressions.

Match all prototypes: sub (.+)$

Match prototypes that don't contain "()": sub ([^($]+)$

Match prototypes that contain "()": sub (.+)\s*\(\)

Match prototypes with at least one compile-time argument check: sub (.+)\s*\((.+)\)
Comment 6 David Kilzer (:ddkilzer) 2011-03-03 18:13:36 PST
(In reply to comment #5)
> For completeness, the sentiment on #perl on freenode seems to be against all uses of prototypes. They referred me to the Usenet post <http://groups.google.com/group/comp.lang.perl.modules/msg/84484de5eb01085b?dmode=source&output=gplain>.

ZOMG.  I didn't have the patience to read through the whole thing.  My experience with prototypes has been generally good as they've caught issues when I didn't pass in the correct number of arguments, and I usually prefer to use parenthesis when calling methods (except for some built-in functions).

I suppose we could also define some standard rules for Perl scripts, although Perl seems to be on its way out in the WebKit project in favor of Python or Ruby.

As I said, I don't feel strongly enough to r- this, but it would be good to settle on a common way to define methods in Perl scripts, at least for the remaining ones.
Comment 7 Daniel Bates 2011-03-06 17:09:38 PST
(In reply to comment #6)
> (In reply to comment #5)
> [...]
> As I said, I don't feel strongly enough to r- this, but it would be good to settle on a common way to define methods in Perl scripts, at least for the remaining ones.

I decided to defer the no-parentheses notation change. I reduced the scope of this bug and its patch to just the misspelled word and sorting the forward declarations.

We should consider standardizing on a notation for our existing Perl scripts.
Comment 8 Daniel Bates 2011-03-06 17:11:57 PST
Committed r80443: <http://trac.webkit.org/changeset/80443>